Disable reloading when weapon use is forbidden (fixes reload spam while frozen)
authorMario <zacjardine@y7mail.com>
Fri, 5 Dec 2014 12:54:36 +0000 (23:54 +1100)
committerMario <zacjardine@y7mail.com>
Fri, 5 Dec 2014 12:54:36 +0000 (23:54 +1100)
qcsrc/server/cl_impulse.qc
qcsrc/server/weapons/selection.qc
qcsrc/server/weapons/weaponsystem.qh

index c6ede7f..76610f4 100644 (file)
@@ -108,7 +108,7 @@ void ImpulseCommands (void)
                                        W_PreviousWeapon(1);
                                        break;
                                case 20:
-                                       WEP_ACTION(self.weapon, WR_RELOAD);
+                                       if(!forbidWeaponUse()) { WEP_ACTION(self.weapon, WR_RELOAD); }
                                        break;
                        }
                }
index 0816ff4..12ffbb9 100644 (file)
@@ -253,7 +253,7 @@ void W_SwitchWeapon(float imp)
                else
                        self.selectweapon = imp; // update selectweapon ANYWAY
        }
-       else { WEP_ACTION(self.weapon, WR_RELOAD); }
+       else if(!forbidWeaponUse()) { WEP_ACTION(self.weapon, WR_RELOAD); }
 }
 
 void W_CycleWeapon(string weaponorder, float dir)
index b185414..ddb1ee6 100644 (file)
@@ -2,3 +2,5 @@ float weaponswapping;
 float internalteam;
 
 void W_DropEvent(float event, entity player, float weapon_type, entity weapon_item);
+
+float forbidWeaponUse();