Logging improvements
This commit is contained in:
parent
58e6cc8cd7
commit
cc488477fb
@ -366,7 +366,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. ${ItemAddedResult[itemAddedResult]}, skipping`,
|
`Failed to place item ${i} of ${totalItemCount} items into ${botRole} containers: ${equipmentSlots.join(",")}. Tried ${fitItemIntoContainerAttempts} times, reason: ${ItemAddedResult[itemAddedResult]}, skipping`,
|
||||||
);
|
);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -374,6 +374,7 @@ export class BotLootGenerator
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// Reset counter
|
||||||
fitItemIntoContainerAttempts = 0;
|
fitItemIntoContainerAttempts = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -180,16 +180,16 @@ export class BotWeaponGeneratorHelper
|
|||||||
const container = inventory.items.find((i) => i.slotId === slot);
|
const container = inventory.items.find((i) => i.slotId === slot);
|
||||||
if (!container)
|
if (!container)
|
||||||
{
|
{
|
||||||
// Desired equipment container (e.g. backpack) not found
|
|
||||||
this.logger.debug(
|
|
||||||
`Unable to add item: ${
|
|
||||||
itemWithChildren[0]._tpl
|
|
||||||
} to: ${slot}, slot missing/bot generated without item in slot`,
|
|
||||||
);
|
|
||||||
|
|
||||||
missingContainerCount++;
|
missingContainerCount++;
|
||||||
if (missingContainerCount === equipmentSlots.length)
|
if (missingContainerCount === equipmentSlots.length)
|
||||||
{
|
{
|
||||||
|
// Bot doesnt have any containers
|
||||||
|
this.logger.debug(
|
||||||
|
`Unable to add item: ${
|
||||||
|
itemWithChildren[0]._tpl
|
||||||
|
} to bot as it lacks the following containers: ${equipmentSlots.join(",")}`,
|
||||||
|
);
|
||||||
|
|
||||||
return ItemAddedResult.NO_CONTAINERS
|
return ItemAddedResult.NO_CONTAINERS
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -210,6 +210,7 @@ export class BotWeaponGeneratorHelper
|
|||||||
// Container has no slots to hold items
|
// Container has no slots to hold items
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get x/y grid size of item
|
// Get x/y grid size of item
|
||||||
const itemSize = this.inventoryHelper.getItemSize(parentTpl, parentId, itemWithChildren);
|
const itemSize = this.inventoryHelper.getItemSize(parentTpl, parentId, itemWithChildren);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user