From 06c60b9fd9632b625d0c8d3d8f85f9e42838a85d Mon Sep 17 00:00:00 2001 From: Dev Date: Thu, 28 Dec 2023 00:06:45 +0000 Subject: [PATCH] Log bot role on error --- project/assets/database/locales/server/en.json | 2 +- project/src/generators/BotEquipmentModGenerator.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/project/assets/database/locales/server/en.json b/project/assets/database/locales/server/en.json index 78ff456b..a62550c4 100644 --- a/project/assets/database/locales/server/en.json +++ b/project/assets/database/locales/server/en.json @@ -20,7 +20,7 @@ "bot-missing_item_template": "Unable to find item template with tpl: %s", "bot-missing_saved_match_info": "getBotCap() Unable to get saved match info, falling back to default. Did you restart the server and not the client?", "bot-missing_weapon_preset": "Unable to find preset for weapon with tpl: %s", - "bot-mod_not_in_slot_filter_list": "Mod: {{modId}} not found in compatible item filter for slot: '{{modSlot}}' for item: {{parentName}}, skipping", + "bot-mod_not_in_slot_filter_list": "Mod: {{modId}} not found in compatible item filter for slot: '{{modSlot}}' for item: {{parentName}}, skipping - {{botRole}}", "bot-mod_slot_missing_from_item": "Slot '{{modSlot}}' does not exist for item: {{parentId}} {{parentName}}", "bot-no_ammo_found_in_bot_json": "Unable to find ammo for bot type: %s", "bot-no_bot_cap_found_for_location": "No bot location cap limit found for bot: %s, using default", diff --git a/project/src/generators/BotEquipmentModGenerator.ts b/project/src/generators/BotEquipmentModGenerator.ts index 98c6ae1c..c04bd462 100644 --- a/project/src/generators/BotEquipmentModGenerator.ts +++ b/project/src/generators/BotEquipmentModGenerator.ts @@ -266,7 +266,7 @@ export class BotEquipmentModGenerator continue; } - if (!this.isModValidForSlot(modToAdd, modsParentSlot, modSlot, parentTemplate)) + if (!this.isModValidForSlot(modToAdd, modsParentSlot, modSlot, parentTemplate, botRole)) { continue; } @@ -792,6 +792,7 @@ export class BotEquipmentModGenerator * @param itemSlot slot the item will be placed in * @param modSlot slot the mod will fill * @param parentTemplate template of the mods parent item + * @param botRole * @returns true if valid */ protected isModValidForSlot( @@ -799,6 +800,7 @@ export class BotEquipmentModGenerator itemSlot: Slot, modSlot: string, parentTemplate: ITemplateItem, + botRole: string ): boolean { // Mod lacks template item