]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' of git://de.git.xonotic.org/xonotic/xonotic-data.pk3dir
authorRudolf Polzer <divverent@alientrap.org>
Sun, 14 Nov 2010 19:02:46 +0000 (20:02 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Sun, 14 Nov 2010 19:02:46 +0000 (20:02 +0100)
qcsrc/server/cl_weaponsystem.qc

index 907f1788196e56adc947c9a0180fb00694231790..fc6edb265d1eba1b77831bb26fd269b8d0e4e6f5 100644 (file)
@@ -1042,6 +1042,7 @@ void W_SwitchToOtherWeapon(entity pl)
        if(ww)
                W_SwitchWeapon_Force(pl, ww);
 }
+.float prevdryfire;
 float weapon_prepareattack_checkammo(float secondary)
 {
        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
@@ -1053,8 +1054,11 @@ float weapon_prepareattack_checkammo(float secondary)
                for(mine = world; (mine = find(mine, classname, "mine")); ) if(mine.owner == self)
                        return FALSE;
 
-               if(self.weapon == self.switchweapon) // only play once BEFORE starting to switch weapons
+               if(self.weapon == self.switchweapon && time - self.prevdryfire > 1) // only play once BEFORE starting to switch weapons
+               {
                        sound (self, CHAN_AUTO, "weapons/dryfire.wav", VOL_BASE, ATTN_NORM);
+                       self.prevdryfire = time;
+               }
 
                W_SwitchToOtherWeapon(self);
                return FALSE;