]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/w_crylink.qc
Fix some redundant checks
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / w_crylink.qc
index f6484d080bf5b4b6b24e216bd49ec52b33ac4b5b..08deaf78c4a81e5ade345c1e9fd8590e5fb194bf 100644 (file)
@@ -258,7 +258,7 @@ void W_Crylink_LinkJoinEffect_Think(void)
                                        e.projectiledeathtype,
                                        other
                                );
-                               Send_Effect("crylink_joinexplode", self.origin, '0 0 0', n);
+                               Send_Effect(EFFECT_CRYLINK_JOINEXPLODE, self.origin, '0 0 0', n);
                        }
                }
        }
@@ -354,13 +354,13 @@ void W_Crylink_Attack(void)
        if(WEP_CVAR_PRI(crylink, joinexplode))
                maxdmg += WEP_CVAR_PRI(crylink, joinexplode_damage);
 
-       W_SetupShot(self, false, 2, "weapons/crylink_fire.wav", CH_WEAPON_A, maxdmg);
+       W_SetupShot(self, false, 2, W_Sound("crylink_fire"), CH_WEAPON_A, maxdmg);
        forward = v_forward;
        right = v_right;
        up = v_up;
 
        shots = WEP_CVAR_PRI(crylink, shots);
-       Send_Effect("crylink_muzzleflash", w_shotorg, w_shotdir * 1000, shots);
+       Send_Effect(EFFECT_CRYLINK_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, shots);
        proj = prevproj = firstproj = world;
        for(counter = 0; counter < shots; ++counter)
        {
@@ -463,13 +463,13 @@ void W_Crylink_Attack2(void)
        if(WEP_CVAR_SEC(crylink, joinexplode))
                maxdmg += WEP_CVAR_SEC(crylink, joinexplode_damage);
 
-       W_SetupShot(self, false, 2, "weapons/crylink_fire2.wav", CH_WEAPON_A, maxdmg);
+       W_SetupShot(self, false, 2, W_Sound("crylink_fire2"), CH_WEAPON_A, maxdmg);
        forward = v_forward;
        right = v_right;
        up = v_up;
 
        shots = WEP_CVAR_SEC(crylink, shots);
-       Send_Effect("crylink_muzzleflash", w_shotorg, w_shotdir * 1000, shots);
+       Send_Effect(EFFECT_CRYLINK_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, shots);
        proj = prevproj = firstproj = world;
        for(counter = 0; counter < shots; ++counter)
        {
@@ -638,12 +638,12 @@ bool W_Crylink(int req)
                }
                case WR_INIT:
                {
-                       precache_model("models/weapons/g_crylink.md3");
-                       precache_model("models/weapons/v_crylink.md3");
-                       precache_model("models/weapons/h_crylink.iqm");
-                       precache_sound("weapons/crylink_fire.wav");
-                       precache_sound("weapons/crylink_fire2.wav");
-                       precache_sound("weapons/crylink_linkjoin.wav");
+                       precache_model(W_Model("g_crylink.md3"));
+                       precache_model(W_Model("v_crylink.md3"));
+                       precache_model(W_Model("h_crylink.iqm"));
+                       precache_sound(W_Sound("crylink_fire"));
+                       precache_sound(W_Sound("crylink_fire2"));
+                       precache_sound(W_Sound("crylink_linkjoin"));
                        CRYLINK_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
                }
@@ -674,7 +674,7 @@ bool W_Crylink(int req)
                }
                case WR_RELOAD:
                {
-                       W_Reload(min(WEP_CVAR_PRI(crylink, ammo), WEP_CVAR_SEC(crylink, ammo)), "weapons/reload.wav");
+                       W_Reload(min(WEP_CVAR_PRI(crylink, ammo), WEP_CVAR_SEC(crylink, ammo)), W_Sound("reload"));
                        return true;
                }
                case WR_SUICIDEMESSAGE:
@@ -700,23 +700,23 @@ bool W_Crylink(int req)
                        org2 = w_org + w_backoff * 2;
                        if(w_deathtype & HITTYPE_SECONDARY)
                        {
-                               pointparticles(particleeffectnum("crylink_impact"), org2, '0 0 0', 1);
+                               pointparticles(particleeffectnum(EFFECT_CRYLINK_IMPACT2), org2, '0 0 0', 1);
                                if(!w_issilent)
-                                       sound(self, CH_SHOTS, "weapons/crylink_impact2.wav", VOL_BASE, ATTN_NORM);
+                                       sound(self, CH_SHOTS, W_Sound("crylink_impact2"), VOL_BASE, ATTN_NORM);
                        }
                        else
                        {
-                               pointparticles(particleeffectnum("crylink_impactbig"), org2, '0 0 0', 1);
+                               pointparticles(particleeffectnum(EFFECT_CRYLINK_IMPACT), org2, '0 0 0', 1);
                                if(!w_issilent)
-                                       sound(self, CH_SHOTS, "weapons/crylink_impact.wav", VOL_BASE, ATTN_NORM);
+                                       sound(self, CH_SHOTS, W_Sound("crylink_impact"), VOL_BASE, ATTN_NORM);
                        }
 
                        return true;
                }
                case WR_INIT:
                {
-                       precache_sound("weapons/crylink_impact2.wav");
-                       precache_sound("weapons/crylink_impact.wav");
+                       precache_sound(W_Sound("crylink_impact2"));
+                       precache_sound(W_Sound("crylink_impact"));
                        return true;
                }
                case WR_ZOOMRETICLE: