]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/w_machinegun.qc
Add a function to control weapon sound paths with hooks
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / w_machinegun.qc
index f320f711469cfb75a72daaa424bf262cafa54388..ac5bc2cb33d5b7c0506b35cafc443c1f9ea9aafd 100644 (file)
@@ -104,7 +104,7 @@ void W_MachineGun_MuzzleFlash(void)
 
 void W_MachineGun_Attack(int deathtype)
 {
-       W_SetupShot(self, true, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, ((self.misc_bulletcounter == 1) ? WEP_CVAR(machinegun, first_damage) : WEP_CVAR(machinegun, sustained_damage)));
+       W_SetupShot(self, true, 0, W_Sound("uzi_fire"), CH_WEAPON_A, ((self.misc_bulletcounter == 1) ? WEP_CVAR(machinegun, first_damage) : WEP_CVAR(machinegun, sustained_damage)));
        if(!autocvar_g_norecoil)
        {
                self.punchangle_x = random() - 0.5;
@@ -180,7 +180,7 @@ void W_MachineGun_Attack_Auto(void)
 
        W_DecreaseAmmo(WEP_CVAR(machinegun, sustained_ammo));
 
-       W_SetupShot(self, true, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, WEP_CVAR(machinegun, sustained_damage));
+       W_SetupShot(self, true, 0, W_Sound("uzi_fire"), CH_WEAPON_A, WEP_CVAR(machinegun, sustained_damage));
        if(!autocvar_g_norecoil)
        {
                self.punchangle_x = random() - 0.5;
@@ -206,7 +206,7 @@ void W_MachineGun_Attack_Auto(void)
 
 void W_MachineGun_Attack_Burst(void)
 {
-       W_SetupShot(self, true, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, WEP_CVAR(machinegun, sustained_damage));
+       W_SetupShot(self, true, 0, W_Sound("uzi_fire"), CH_WEAPON_A, WEP_CVAR(machinegun, sustained_damage));
        if(!autocvar_g_norecoil)
        {
                self.punchangle_x = random() - 0.5;
@@ -305,10 +305,10 @@ bool W_MachineGun(int req)
                case WR_INIT:
                {
                        precache_model("models/uziflash.md3");
-                       precache_model("models/weapons/g_uzi.md3");
-                       precache_model("models/weapons/v_uzi.md3");
-                       precache_model("models/weapons/h_uzi.iqm");
-                       precache_sound("weapons/uzi_fire.wav");
+                       precache_model(W_Model("g_uzi.md3"));
+                       precache_model(W_Model("v_uzi.md3"));
+                       precache_model(W_Model("h_uzi.iqm"));
+                       precache_sound(W_Sound("uzi_fire"));
                        MACHINEGUN_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
                }