SERVER: Fix Flamethrower regeneration

This commit is contained in:
cypress 2023-10-17 08:54:27 -04:00
parent 835fdcb1e2
commit a3f2c2cb7e
2 changed files with 9 additions and 7 deletions

View file

@ -323,17 +323,19 @@ void() PlayerPreThink =
JumpCheck(0); JumpCheck(0);
// refuel/cool m2 // refuel/cool flamethrowers
if (self.ltime < time) { if (self.ltime < time) {
if (self.currentmag == 0 && !self.cooldown) { if (self.weapons[0].weapon_magazine == 0 && !self.cooldown) {
self.cooldown = true; self.cooldown = true;
} }
if (self.cooldown && self.currentmag > 20) if (self.cooldown && self.weapons[0].weapon_magazine > 20)
self.cooldown = false; self.cooldown = false;
if (self.weapon == W_M2 || self.weapon == W_FIW && self.currentmag < getWeaponMag(self.weapon)) if (GetFiretype(self.weapon) == FIRETYPE_FLAME &&
self.currentmag += 1; self.weapons[0].weapon_magazine < getWeaponMag(self.weapon)) {
self.weapons[0].weapon_magazine += 1;
}
self.ltime = time + 0.1; self.ltime = time + 0.1;
} }

View file

@ -382,7 +382,7 @@ void(float side) W_Reload =
if (self.zoom == 2) if (self.zoom == 2)
return; return;
if (self.weapon == W_M2 || self.weapon == W_FIW) if (GetFiretype(self.weapon) == FIRETYPE_FLAME)
return; return;
if (side == S_BOTH) { if (side == S_BOTH) {
@ -996,7 +996,7 @@ void (float shotcount, float sprd, float Damage, float side) FireTrace =
void(float side) W_Fire = 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; return;
if (self.semiswitch == true) if (self.semiswitch == true)