Merge remote branch 'refs/remotes/origin/fruitiex/outofammosound'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_weaponsystem.qc
index 9e1eedae0339cac49b07111f5f2a04beee7ee49c..4537573c5d57b28c6ed7757a4aea131bcd78d109 100644 (file)
@@ -1117,6 +1117,9 @@ 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
+                       sound (self, CHAN_AUTO, "weapons/dryfire.wav", VOL_BASE, ATTN_NORM);
+
                W_SwitchToOtherWeapon(self);
                return FALSE;
        }