From c2aaf9c6fb1202bff6661a730584f0bf4c3f41e5 Mon Sep 17 00:00:00 2001 From: Dev Date: Fri, 17 Nov 2023 12:40:23 +0000 Subject: [PATCH] Add workaround for stm-9 generating with an impossible configuration and being reset to default --- .../generators/BotEquipmentModGenerator.ts | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/project/src/generators/BotEquipmentModGenerator.ts b/project/src/generators/BotEquipmentModGenerator.ts index 4426ce4c..d0c6785e 100644 --- a/project/src/generators/BotEquipmentModGenerator.ts +++ b/project/src/generators/BotEquipmentModGenerator.ts @@ -654,7 +654,7 @@ export class BotEquipmentModGenerator modTpl, modSlot, ); - if (!modCompatibilityResult.incompatible) + if (!modCompatibilityResult.incompatible && !this.weaponModComboIsIncompatible(weapon, modTpl)) { found = true; @@ -666,6 +666,7 @@ export class BotEquipmentModGenerator if (modCompatibilityResult.incompatible && parentSlot._required) { this.logger.debug(modCompatibilityResult.reason); + this.logger.debug(`Weapon: ${weapon.map(x => `${x._tpl} ${x.slotId ?? ""}`).join(",")}`) } } @@ -699,6 +700,23 @@ export class BotEquipmentModGenerator return this.itemHelper.getItem(modTpl); } + /** + * Temp fix to prevent certain combinations of weapons with mods that are known to be incompatible + * @param weapon Weapon + * @param modTpl Mod to check compatibility with weapon + * @returns True if incompatible + */ + protected weaponModComboIsIncompatible(weapon: Item[], modTpl: string): boolean + { + // STM-9 + AR-15 Lone Star Ion Lite handguard + if (weapon[0]._tpl === "60339954d62c9b14ed777c06" && modTpl === "5d4405f0a4b9361e6a4e6bd9") + { + return true; + } + + return false; + } + /** * Create a mod item with parameters as properties * @param modId _id