mirror of
https://github.com/sp-tarkov/server.git
synced 2025-02-13 09:50:43 -05:00
Added system to strip children from containers defined in new config property tplsToStripChildItemsFrom
Fixes Christmas gifts causing strange behaviour when moved to stash as we generate container gift loot when player opens then
This commit is contained in:
parent
0eb31c468f
commit
33591df715
@ -539,5 +539,11 @@
|
||||
"nonTriggered": 80,
|
||||
"triggered": 90
|
||||
},
|
||||
"tplsToStripChildItemsFrom": [
|
||||
"63a8970d7108f713591149f5",
|
||||
"63a897c6b1ff6e29734fcc95",
|
||||
"63a898a328e385334e0640a5",
|
||||
"634959225289190e5e773b3b"
|
||||
],
|
||||
"nonMaps": ["base", "develop", "hideout", "privatearea", "suburbs", "terminal", "town"]
|
||||
}
|
||||
|
@ -429,7 +429,10 @@ export class LocationLootGenerator {
|
||||
const tplsToAddToContainer = tplsForced.concat(chosenTpls);
|
||||
for (const tplToAdd of tplsToAddToContainer) {
|
||||
const chosenItemWithChildren = this.createStaticLootItem(tplToAdd, staticAmmoDist, parentId);
|
||||
const items = chosenItemWithChildren.items;
|
||||
|
||||
const items = this.locationConfig.tplsToStripChildItemsFrom.includes(tplToAdd)
|
||||
? [chosenItemWithChildren.items[0]] // Strip children from parent
|
||||
: chosenItemWithChildren.items;
|
||||
const width = chosenItemWithChildren.width;
|
||||
const height = chosenItemWithChildren.height;
|
||||
|
||||
@ -918,6 +921,11 @@ export class LocationLootGenerator {
|
||||
// Ensure all IDs are unique
|
||||
itemWithChildren = this.itemHelper.replaceIDs(itemWithChildren);
|
||||
|
||||
if (this.locationConfig.tplsToStripChildItemsFrom.includes(chosenItem._tpl)) {
|
||||
// Strip children from parent before adding
|
||||
itemWithChildren = [itemWithChildren[0]];
|
||||
}
|
||||
|
||||
itemWithMods.push(...itemWithChildren);
|
||||
}
|
||||
|
||||
|
@ -45,6 +45,8 @@ export interface ILocationConfig extends IBaseConfig {
|
||||
equipmentLootSettings: IEquipmentLootSettings;
|
||||
/** min percentage to set raider spawns at, -1 makes no changes */
|
||||
reserveRaiderSpawnChanceOverrides: IReserveRaiderSpawnChanceOverrides;
|
||||
/** Containers to remove all children from when generating static/loose loot */
|
||||
tplsToStripChildItemsFrom: string[];
|
||||
/** Map ids players cannot visit */
|
||||
nonMaps: string[];
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user