dryfire.wav sound when out of ammo
authorFruitieX <rasse@rasse-laptop.(none)>
Mon, 18 Oct 2010 23:46:20 +0000 (02:46 +0300)
committerFruitieX <rasse@rasse-laptop.(none)>
Mon, 18 Oct 2010 23:46:20 +0000 (02:46 +0300)
qcsrc/server/cl_weaponsystem.qc
qcsrc/server/miscfunctions.qc
sound/weapons/dryfire.wav [new file with mode: 0644]

index c9a5dfc4aa1b9d61236355e94824506004053edb..ba30b1f81e83e37dac64f75cc9ce77217a03e649 100644 (file)
@@ -1106,6 +1106,9 @@ float weapon_prepareattack_checkammo(float secondary)
                for(mine = world; (mine = find(mine, classname, "mine")); ) if(mine.owner == self)
                        return FALSE;
 
                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;
        }
                W_SwitchToOtherWeapon(self);
                return FALSE;
        }
index d4232424072f84aa90d2c7fd220371e4a91aa923..59428f65dbca241c03f7b330440cdd8cf75fce98 100644 (file)
@@ -1668,6 +1668,7 @@ void precache()
     precache_sound ("weapons/weapon_switch.wav");
     precache_sound ("weapons/weaponpickup.wav");
     precache_sound ("weapons/unavailable.wav");
     precache_sound ("weapons/weapon_switch.wav");
     precache_sound ("weapons/weaponpickup.wav");
     precache_sound ("weapons/unavailable.wav");
+    precache_sound ("weapons/dryfire.wav");
     if (g_grappling_hook)
     {
         precache_sound ("weapons/hook_fire.wav"); // hook
     if (g_grappling_hook)
     {
         precache_sound ("weapons/hook_fire.wav"); // hook
diff --git a/sound/weapons/dryfire.wav b/sound/weapons/dryfire.wav
new file mode 100644 (file)
index 0000000..81e86b1
Binary files /dev/null and b/sound/weapons/dryfire.wav differ