From 480967ab9ad571c2b8479a95b9c309ebcb234d69 Mon Sep 17 00:00:00 2001 From: Dev Date: Tue, 17 Oct 2023 20:45:40 +0100 Subject: [PATCH] Incldue m4a1 with gas block item in `modIsFrontOrRearSight()` check --- project/src/generators/BotEquipmentModGenerator.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/project/src/generators/BotEquipmentModGenerator.ts b/project/src/generators/BotEquipmentModGenerator.ts index bce2edee..7f9a583d 100644 --- a/project/src/generators/BotEquipmentModGenerator.ts +++ b/project/src/generators/BotEquipmentModGenerator.ts @@ -260,7 +260,7 @@ export class BotEquipmentModGenerator } // If front/rear sight are to be added, set opposite to 100% chance - if (this.modIsFrontOrRearSight(modSlot)) + if (this.modIsFrontOrRearSight(modSlot, modToAddTemplate._id)) { modSpawnChances.mod_sight_front = 100; modSpawnChances.mod_sight_rear = 100; @@ -317,8 +317,13 @@ export class BotEquipmentModGenerator * @param modSlot Slot to check * @returns true if it's a front/rear sight */ - protected modIsFrontOrRearSight(modSlot: string): boolean + protected modIsFrontOrRearSight(modSlot: string, tpl: string): boolean { + if (modSlot === "mod_gas_block" && tpl === "5ae30e795acfc408fb139a0b") // M4A1 front sight with gas block + { + return true; + } + return ["mod_sight_front", "mod_sight_rear"].includes(modSlot); }