Improved fillMagazineWithRandomCartridge() logging

(cherry picked from commit f406918bb8)
This commit is contained in:
Dev 2024-07-17 11:48:57 +01:00
parent 13abd077dd
commit 5e3899c426

View File

@ -1414,8 +1414,11 @@ export class ItemHelper
);
if (!cartridgeTpl)
{
this.logger.debug(`Unable to fill item: ${magazine[0]._id} ${magTemplate._name} with cartrides as none were found.`);
return;
}
this.fillMagazineWithCartridge(magazine, magTemplate, cartridgeTpl, minSizePercent);
}
@ -1562,9 +1565,10 @@ export class ItemHelper
if (!ammos && !fallbackCartridgeTpl)
{
this.logger.error(
this.logger.debug(
`Unable to pick a cartridge for caliber: ${caliber} as staticAmmoDist has no data. No fallback value provided`,
);
return;
}
const ammoArray = new ProbabilityObjectArray<string>(this.mathUtil, this.cloner);