From 0bf2cf38fe0004f83a0e0d8d3ab232133ff9cabf Mon Sep 17 00:00:00 2001 From: Dev Date: Tue, 20 Feb 2024 09:07:48 +0000 Subject: [PATCH] Add logging to `drawAmmoTpl` to help with finding mod errors --- project/src/helpers/ItemHelper.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/project/src/helpers/ItemHelper.ts b/project/src/helpers/ItemHelper.ts index faea3c72..632779c9 100644 --- a/project/src/helpers/ItemHelper.ts +++ b/project/src/helpers/ItemHelper.ts @@ -1287,7 +1287,14 @@ export class ItemHelper const ammos = staticAmmoDist[caliber]; if (!ammos) { - this.logger.error(`missing caliber data for: ${caliber}`); + this.logger.error(`Missing caliber data for: ${caliber}`); + } + + if (!Array.isArray(ammos)) + { + this.logger.error( + `Unable to pick a cartridge for caliber ${caliber}, chosen staticAmmoDist data is not an array: ${ammos}`, + ); } for (const icd of ammos)