From 81393fb62909a9bf48e25102e5bc508b60b1023a Mon Sep 17 00:00:00 2001 From: Dev Date: Sat, 30 Dec 2023 10:45:12 +0000 Subject: [PATCH] Improve error logging in weapon gen --- project/assets/database/locales/server/en.json | 2 +- project/src/generators/BotWeaponGenerator.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/project/assets/database/locales/server/en.json b/project/assets/database/locales/server/en.json index b7b2eb69..94359e0a 100644 --- a/project/assets/database/locales/server/en.json +++ b/project/assets/database/locales/server/en.json @@ -42,7 +42,7 @@ "bot-unable_to_get_bot_fallback_to_assault": "Unable to find bot: %s JSON, using assault bot as fallback", "bot-weapon_contains_invalid_item": "Required slot '{{modSlot}}' on {{weaponTpl}} has an invalid item: {{modName}}", "bot-weapon_generated_incorrect_using_default": "Weapon %s was generated incorrectly, falling back to weapon preset see error above", - "bot-weapon_missing_magazine_or_chamber": "Weapon with tpl: %s has no magazine or chamber", + "bot-weapon_missing_magazine_or_chamber": "Weapon with tpl: {{weaponId}} has no magazine or chamber - {{botRole}}", "bot-weapon_missing_mod_slot": "Slot: {{modSlot}}' does not exist for weapon: {{weaponId}} {{weaponName}} on {{botRole}}", "bot-weapons_required_slot_missing_item": "Required slot '{{modSlot}}' on {{modName}} {{slotId}} was empty on {{botRole}}", "bot-item_missing_props_property": "Item {{itemTpl}} {{name}} is missing a _props property", diff --git a/project/src/generators/BotWeaponGenerator.ts b/project/src/generators/BotWeaponGenerator.ts index 8655e9cd..46094e79 100644 --- a/project/src/generators/BotWeaponGenerator.ts +++ b/project/src/generators/BotWeaponGenerator.ts @@ -568,13 +568,13 @@ export class BotWeaponGenerator { // Shouldn't happen this.logger.warning( - this.localisationService.getText("bot-weapon_missing_magazine_or_chamber", weaponTemplate._id), + this.localisationService.getText("bot-weapon_missing_magazine_or_chamber", {weaponId: weaponTemplate._id, botRole: botRole}), ); } const defaultMagTplId = this.botWeaponGeneratorHelper.getWeaponsDefaultMagazineTpl(weaponTemplate); this.logger.debug( - `[${botRole}] Unable to find magazine for weapon ${weaponTemplate._id} ${weaponTemplate._name}, using mag template default ${defaultMagTplId}.`, + `[${botRole}] Unable to find magazine for weapon: ${weaponTemplate._id} ${weaponTemplate._name}, using mag template default: ${defaultMagTplId}.`, ); return defaultMagTplId;