]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
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 c6ede7f981fad61358c959dd02eeefe4d05ca118..76610f4c3e57da54d79fc73dcbb1ebcb9aabe0a9 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 0816ff44a5b43ff9b566467ee8565248c9d1ad0c..12ffbb9b49bd17d2f5f664bd824dc99f97352767 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 b1854145bbbcadb18062a76a9bd0515e187be091..ddb1ee69588aa578c3394b427fa158eb27ab7a96 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();