]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/w_hook.qc
Add a function to control weapon sound paths with hooks
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / w_hook.qc
index a8d33e8704bb16937d34ec41b29612412002f8fe..b877254c3d53740be925b358fb02b0470b7bb273 100644 (file)
@@ -134,7 +134,7 @@ void W_Hook_Attack2(void)
        entity gren;
 
        //W_DecreaseAmmo(WEP_CVAR_SEC(hook, ammo)); // WEAPONTODO: Figure out how to handle ammo with hook secondary (gravitybomb)
-       W_SetupShot(self, false, 4, "weapons/hookbomb_fire.wav", CH_WEAPON_A, WEP_CVAR_SEC(hook, damage));
+       W_SetupShot(self, false, 4, W_Sound("hookbomb_fire"), CH_WEAPON_A, WEP_CVAR_SEC(hook, damage));
 
        gren = spawn();
        gren.owner = gren.realowner = self;
@@ -288,12 +288,12 @@ bool W_Hook(int req)
                }
                case WR_INIT:
                {
-                       precache_model("models/weapons/g_hookgun.md3");
-                       precache_model("models/weapons/v_hookgun.md3");
-                       precache_model("models/weapons/h_hookgun.iqm");
-                       precache_sound("weapons/hook_impact.wav"); // done by g_hook.qc
-                       precache_sound("weapons/hook_fire.wav");
-                       precache_sound("weapons/hookbomb_fire.wav");
+                       precache_model(W_Model("g_hookgun.md3"));
+                       precache_model(W_Model("v_hookgun.md3"));
+                       precache_model(W_Model("h_hookgun.iqm"));
+                       precache_sound(W_Sound("hook_impact")); // done by g_hook.qc
+                       precache_sound(W_Sound("hook_fire"));
+                       precache_sound(W_Sound("hookbomb_fire"));
                        HOOK_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
                }