From 164bf08b08885a5509800b8771f9ad87783f6269 Mon Sep 17 00:00:00 2001 From: Dev Date: Sat, 3 Feb 2024 14:00:47 +0000 Subject: [PATCH] FIx armor filtering code to correctly return non-armored rigs when requested --- project/src/generators/BotInventoryGenerator.ts | 2 +- project/src/generators/BotWeaponGenerator.ts | 2 +- project/src/helpers/QuestHelper.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/project/src/generators/BotInventoryGenerator.ts b/project/src/generators/BotInventoryGenerator.ts index 0e9437bc..084379d8 100644 --- a/project/src/generators/BotInventoryGenerator.ts +++ b/project/src/generators/BotInventoryGenerator.ts @@ -290,7 +290,7 @@ export class BotInventoryGenerator const tacVestsWithoutArmor = Object.entries(templateInventory.equipment.TacticalVest).reduce( (newVestDictionary, [tplKey]) => { - if (this.itemHelper.itemHasSlots(tplKey)) + if (!this.itemHelper.itemHasSlots(tplKey)) { newVestDictionary[tplKey] = templateInventory.equipment.TacticalVest[tplKey]; } diff --git a/project/src/generators/BotWeaponGenerator.ts b/project/src/generators/BotWeaponGenerator.ts index c64c537a..a617b0d5 100644 --- a/project/src/generators/BotWeaponGenerator.ts +++ b/project/src/generators/BotWeaponGenerator.ts @@ -200,7 +200,7 @@ export class BotWeaponGenerator } // Fill existing magazines to full and sync ammo type - for (const magazine of weaponWithModsArray.filter((x) => x.slotId === this.modMagazineSlotId)) + for (const magazine of weaponWithModsArray.filter((item) => item.slotId === this.modMagazineSlotId)) { this.fillExistingMagazines(weaponWithModsArray, magazine, ammoTpl); } diff --git a/project/src/helpers/QuestHelper.ts b/project/src/helpers/QuestHelper.ts index 39bf6cfc..8c56334d 100644 --- a/project/src/helpers/QuestHelper.ts +++ b/project/src/helpers/QuestHelper.ts @@ -361,7 +361,7 @@ export class QuestHelper // Remap target id to the new presets root id questReward.target = rootItem._id; - // Copy over stack count + // Copy over stack count otherwise reward shows as missing in client if (!rootItem.upd) { rootItem.upd = {};