From 27e16e09d7d03fb5b167e770f5becc4cb7dafba6 Mon Sep 17 00:00:00 2001 From: Dev Date: Fri, 24 Nov 2023 15:26:41 +0000 Subject: [PATCH] log when `addLooseWeaponsToInventorySlot()` fails to add weapon to bot inventory --- project/src/generators/BotLootGenerator.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/project/src/generators/BotLootGenerator.ts b/project/src/generators/BotLootGenerator.ts index 8bd4d68f..83038ed3 100644 --- a/project/src/generators/BotLootGenerator.ts +++ b/project/src/generators/BotLootGenerator.ts @@ -358,7 +358,7 @@ export class BotLootGenerator if (fitItemIntoContainerAttempts >= 4) { this.logger.debug( - `Failed to place item ${i} of ${totalItemCount} item into ${botRole} container: ${equipmentSlots}, ${fitItemIntoContainerAttempts} times, skipping`, + `Failed to place item ${i} of ${totalItemCount} item into ${botRole} container: ${equipmentSlots}, ${fitItemIntoContainerAttempts} times. No space, skipping`, ); break; @@ -426,13 +426,18 @@ export class BotLootGenerator isPmc, botLevel, ); - this.botWeaponGeneratorHelper.addItemWithChildrenToEquipmentSlot( + const result = this.botWeaponGeneratorHelper.addItemWithChildrenToEquipmentSlot( [equipmentSlot], generatedWeapon.weapon[0]._id, generatedWeapon.weapon[0]._tpl, [...generatedWeapon.weapon], botInventory, ); + + if (result !== ItemAddedResult.SUCCESS) + { + this.logger.debug(`Failed to add additional weapon ${generatedWeapon.weapon[0]._id} to bot backpack, reason: ${result}`); + } } } }