log when addLooseWeaponsToInventorySlot() fails to add weapon to bot inventory

This commit is contained in:
Dev 2023-11-24 15:26:41 +00:00
parent 7342849f61
commit 27e16e09d7

View File

@ -358,7 +358,7 @@ export class BotLootGenerator
if (fitItemIntoContainerAttempts >= 4) if (fitItemIntoContainerAttempts >= 4)
{ {
this.logger.debug( 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; break;
@ -426,13 +426,18 @@ export class BotLootGenerator
isPmc, isPmc,
botLevel, botLevel,
); );
this.botWeaponGeneratorHelper.addItemWithChildrenToEquipmentSlot( const result = this.botWeaponGeneratorHelper.addItemWithChildrenToEquipmentSlot(
[equipmentSlot], [equipmentSlot],
generatedWeapon.weapon[0]._id, generatedWeapon.weapon[0]._id,
generatedWeapon.weapon[0]._tpl, generatedWeapon.weapon[0]._tpl,
[...generatedWeapon.weapon], [...generatedWeapon.weapon],
botInventory, botInventory,
); );
if (result !== ItemAddedResult.SUCCESS)
{
this.logger.debug(`Failed to add additional weapon ${generatedWeapon.weapon[0]._id} to bot backpack, reason: ${result}`);
}
} }
} }
} }