mirror of
https://github.com/sp-tarkov/server.git
synced 2025-02-13 09:50:43 -05:00
Updated static loot generation to better handle malformed modded items
This commit is contained in:
parent
0b287a831a
commit
6081a19cab
@ -429,6 +429,9 @@ export class LocationLootGenerator {
|
|||||||
const tplsToAddToContainer = tplsForced.concat(chosenTpls);
|
const tplsToAddToContainer = tplsForced.concat(chosenTpls);
|
||||||
for (const tplToAdd of tplsToAddToContainer) {
|
for (const tplToAdd of tplsToAddToContainer) {
|
||||||
const chosenItemWithChildren = this.createStaticLootItem(tplToAdd, staticAmmoDist, parentId);
|
const chosenItemWithChildren = this.createStaticLootItem(tplToAdd, staticAmmoDist, parentId);
|
||||||
|
if (!chosenItemWithChildren) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
const items = this.locationConfig.tplsToStripChildItemsFrom.includes(tplToAdd)
|
const items = this.locationConfig.tplsToStripChildItemsFrom.includes(tplToAdd)
|
||||||
? [chosenItemWithChildren.items[0]] // Strip children from parent
|
? [chosenItemWithChildren.items[0]] // Strip children from parent
|
||||||
@ -956,6 +959,11 @@ export class LocationLootGenerator {
|
|||||||
parentId?: string,
|
parentId?: string,
|
||||||
): IContainerItem {
|
): IContainerItem {
|
||||||
const itemTemplate = this.itemHelper.getItem(chosenTpl)[1];
|
const itemTemplate = this.itemHelper.getItem(chosenTpl)[1];
|
||||||
|
if (!itemTemplate._props) {
|
||||||
|
this.logger.error(`Unable to process item: ${chosenTpl}. it lacks _props`);
|
||||||
|
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
let width = itemTemplate._props.Width;
|
let width = itemTemplate._props.Width;
|
||||||
let height = itemTemplate._props.Height;
|
let height = itemTemplate._props.Height;
|
||||||
let items: IItem[] = [{ _id: this.hashUtil.generate(), _tpl: chosenTpl }];
|
let items: IItem[] = [{ _id: this.hashUtil.generate(), _tpl: chosenTpl }];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user