diff --git a/project/src/generators/BotInventoryGenerator.ts b/project/src/generators/BotInventoryGenerator.ts index 22af49fc..0e9437bc 100644 --- a/project/src/generators/BotInventoryGenerator.ts +++ b/project/src/generators/BotInventoryGenerator.ts @@ -269,7 +269,7 @@ export class BotInventoryGenerator const tacVestsWithArmor = Object.entries(templateInventory.equipment.TacticalVest).reduce( (newVestDictionary, [tplKey]) => { - if (this.itemHelper.getItem(tplKey)[1]._props.Slots?.length > 0) + if (this.itemHelper.itemHasSlots(tplKey)) { newVestDictionary[tplKey] = templateInventory.equipment.TacticalVest[tplKey]; } @@ -290,7 +290,7 @@ export class BotInventoryGenerator const tacVestsWithoutArmor = Object.entries(templateInventory.equipment.TacticalVest).reduce( (newVestDictionary, [tplKey]) => { - if (this.itemHelper.getItem(tplKey)[1]._props.Slots?.length === 0) + if (this.itemHelper.itemHasSlots(tplKey)) { newVestDictionary[tplKey] = templateInventory.equipment.TacticalVest[tplKey]; } diff --git a/project/src/helpers/ItemHelper.ts b/project/src/helpers/ItemHelper.ts index 020f4615..b6624d19 100644 --- a/project/src/helpers/ItemHelper.ts +++ b/project/src/helpers/ItemHelper.ts @@ -275,6 +275,11 @@ export class ItemHelper return [false, undefined]; } + public itemHasSlots(itemTpl: string): boolean + { + return this.getItem(itemTpl)[1]._props.Slots?.length > 0; + } + public isItemInDb(tpl: string): boolean { const itemDetails = this.getItem(tpl); diff --git a/project/src/helpers/QuestHelper.ts b/project/src/helpers/QuestHelper.ts index 496cf3fc..3dd747a7 100644 --- a/project/src/helpers/QuestHelper.ts +++ b/project/src/helpers/QuestHelper.ts @@ -270,8 +270,12 @@ export class QuestHelper // Is armor item that may need inserts / plates if (questReward.items.length === 1 && this.itemHelper.armorItemCanHoldMods(rootItem._tpl)) { - // Attempt to pull default preset from globals and add child items to reward - this.generateArmorRewardChildSlots(rootItem, questReward); + // Only process items with slots + if (this.itemHelper.itemHasSlots(rootItem._tpl)) + { + // Attempt to pull default preset from globals and add child items to reward + this.generateArmorRewardChildSlots(rootItem, questReward); + } } for (const item of questReward.items)