From 5e510bbd57da4e604b06a3af903a4ccf3df5f547 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 26 Jan 2025 07:53:19 +0000 Subject: [PATCH] Disable MachineGun spread damage multipliers when set to 0 for compatibility --- qcsrc/common/weapons/weapon/machinegun.qc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/qcsrc/common/weapons/weapon/machinegun.qc b/qcsrc/common/weapons/weapon/machinegun.qc index 89d3692a1..b9d459313 100644 --- a/qcsrc/common/weapons/weapon/machinegun.qc +++ b/qcsrc/common/weapons/weapon/machinegun.qc @@ -49,10 +49,11 @@ float MachineGun_Heat(float spread_accum) // example where low end has halved damage and high end has tripled damage: // with 50% spread accumulation: heat = (0.5 * 0.5) + (0.5 * 3) = 0.25 + 1.5 = 1.75 damage multiplier // with 90% spread accumulation: heat = (0.1 * 0.5) + (0.9 * 3) = 0.05 + 2.7 = 2.75 damage multiplier - float heat = (coldMultiplierApplicationPercent * WEP_CVAR(WEP_MACHINEGUN, spread_cold_damagemultiplier)) - + (heatMultiplierApplicationPercent * WEP_CVAR(WEP_MACHINEGUN, spread_heat_damagemultiplier)); - - return heat; + // NOTE: multipliers do not apply when unset for compatibility + float cold_multiplier = WEP_CVAR(WEP_MACHINEGUN, spread_cold_damagemultiplier); + float heat_multiplier = WEP_CVAR(WEP_MACHINEGUN, spread_heat_damagemultiplier); + return (cold_multiplier ? coldMultiplierApplicationPercent * cold_multiplier : coldMultiplierApplicationPercent) + + (heat_multiplier ? heatMultiplierApplicationPercent * heat_multiplier : heatMultiplierApplicationPercent); } void W_MachineGun_Attack(Weapon thiswep, int deathtype, entity actor, .entity weaponentity) -- 2.39.5