From a3f2c2cb7e34caa22b407a3fe287ef2e1f48afc7 Mon Sep 17 00:00:00 2001 From: cypress Date: Tue, 17 Oct 2023 08:54:27 -0400 Subject: [PATCH] SERVER: Fix Flamethrower regeneration --- source/server/player.qc | 12 +++++++----- source/server/weapons/weapon_core.qc | 4 ++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/source/server/player.qc b/source/server/player.qc index 764c4c7..a98b4b0 100644 --- a/source/server/player.qc +++ b/source/server/player.qc @@ -323,17 +323,19 @@ void() PlayerPreThink = JumpCheck(0); - // refuel/cool m2 + // refuel/cool flamethrowers if (self.ltime < time) { - if (self.currentmag == 0 && !self.cooldown) { + if (self.weapons[0].weapon_magazine == 0 && !self.cooldown) { self.cooldown = true; } - if (self.cooldown && self.currentmag > 20) + if (self.cooldown && self.weapons[0].weapon_magazine > 20) self.cooldown = false; - if (self.weapon == W_M2 || self.weapon == W_FIW && self.currentmag < getWeaponMag(self.weapon)) - self.currentmag += 1; + if (GetFiretype(self.weapon) == FIRETYPE_FLAME && + self.weapons[0].weapon_magazine < getWeaponMag(self.weapon)) { + self.weapons[0].weapon_magazine += 1; + } self.ltime = time + 0.1; } diff --git a/source/server/weapons/weapon_core.qc b/source/server/weapons/weapon_core.qc index 9a8d369..69e79af 100644 --- a/source/server/weapons/weapon_core.qc +++ b/source/server/weapons/weapon_core.qc @@ -382,7 +382,7 @@ void(float side) W_Reload = if (self.zoom == 2) return; - if (self.weapon == W_M2 || self.weapon == W_FIW) + if (GetFiretype(self.weapon) == FIRETYPE_FLAME) return; if (side == S_BOTH) { @@ -996,7 +996,7 @@ void (float shotcount, float sprd, float Damage, float side) FireTrace = void(float side) W_Fire = { - if (self.weapon == W_M2 || self.weapon == W_FIW && self.cooldown) + if (GetFiretype(self.weapon) == FIRETYPE_FLAME && self.cooldown) return; if (self.semiswitch == true)