From 5e3899c4269212619ed338cfbf632ce7764bfcf9 Mon Sep 17 00:00:00 2001 From: Dev Date: Wed, 17 Jul 2024 11:48:57 +0100 Subject: [PATCH] Improved `fillMagazineWithRandomCartridge()` logging (cherry picked from commit f406918bb8bf418ad32daabb947e1004282c1f0b) --- project/src/helpers/ItemHelper.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/project/src/helpers/ItemHelper.ts b/project/src/helpers/ItemHelper.ts index 38afe7b7..4b444d9b 100644 --- a/project/src/helpers/ItemHelper.ts +++ b/project/src/helpers/ItemHelper.ts @@ -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(this.mathUtil, this.cloner);