From: Mario Date: Mon, 24 Aug 2015 06:51:38 +0000 (+1000) Subject: Use the function in client code too X-Git-Tag: xonotic-v0.8.2~2040^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=823702246ca2f7b69a926fcf266911bd35f3c1b5;p=xonotic%2Fxonotic-data.pk3dir.git Use the function in client code too --- diff --git a/qcsrc/client/casings.qc b/qcsrc/client/casings.qc index 8961af224..09c2e6853 100644 --- a/qcsrc/client/casings.qc +++ b/qcsrc/client/casings.qc @@ -2,6 +2,7 @@ #include "_all.qh" #include "../common/movetypes/movetypes.qh" +#include "../common/weapons/all.qh" #include "prandom.qh" #include "rubble.qh" @@ -63,10 +64,10 @@ void Casing_Touch() switch(self.state) { case 1: - s = strcat("weapons/casings", itos(f), ".wav"); + s = W_Sound(strcat("casings", itos(f))); break; default: - s = strcat("weapons/brass", itos(f), ".wav"); + s = W_Sound(strcat("brass", itos(f))); break; } @@ -145,10 +146,10 @@ void Casings_Precache() { precache_model("models/casing_shell.mdl"); precache_model("models/casing_bronze.iqm"); - precache_sound("weapons/brass1.wav"); - precache_sound("weapons/brass2.wav"); - precache_sound("weapons/brass3.wav"); - precache_sound("weapons/casings1.wav"); - precache_sound("weapons/casings2.wav"); - precache_sound("weapons/casings3.wav"); + precache_sound(W_Sound("brass1.wav")); + precache_sound(W_Sound("brass2.wav")); + precache_sound(W_Sound("brass3.wav")); + precache_sound(W_Sound("casings1.wav")); + precache_sound(W_Sound("casings2.wav")); + precache_sound(W_Sound("casings3.wav")); } diff --git a/qcsrc/client/damage.qc b/qcsrc/client/damage.qc index 9479f5786..05d9dfe6f 100644 --- a/qcsrc/client/damage.qc +++ b/qcsrc/client/damage.qc @@ -232,34 +232,34 @@ void Ent_DamageInfo(float isNew) // spiderbot case DEATH_VH_SPID_MINIGUN: string _snd; - _snd = strcat("weapons/ric", ftos(1 + rint(random() * 2)), ".waw"); + _snd = W_Sound(strcat("ric", ftos(1 + rint(random() * 2)))); sound(self, CH_SHOTS, _snd, VOL_BASE, ATTEN_NORM); pointparticles(particleeffectnum("spiderbot_minigun_impact"), self.origin, w_backoff * 1000, 1); break; case DEATH_VH_SPID_ROCKET: - sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); pointparticles(particleeffectnum("spiderbot_rocket_explode"), self.origin, w_backoff * 1000, 1); break; case DEATH_VH_SPID_DEATH: - sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_MIN); + sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_MIN); pointparticles(particleeffectnum("explosion_big"), self.origin, w_backoff * 1000, 1); break; case DEATH_VH_WAKI_GUN: - sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, W_Sound("laserimpact"), VOL_BASE, ATTEN_NORM); pointparticles(particleeffectnum("wakizashi_gun_impact"), self.origin, w_backoff * 1000, 1); break; case DEATH_VH_WAKI_ROCKET: - sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); pointparticles(particleeffectnum("wakizashi_rocket_explode"), self.origin, w_backoff * 1000, 1); break; case DEATH_VH_WAKI_DEATH: - sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_MIN); + sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_MIN); pointparticles(particleeffectnum("explosion_big"), self.origin, w_backoff * 1000, 1); break; case DEATH_VH_RAPT_CANNON: - sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, W_Sound("laserimpact"), VOL_BASE, ATTEN_NORM); pointparticles(particleeffectnum("raptor_cannon_impact"), self.origin, w_backoff * 1000, 1); break; case DEATH_VH_RAPT_FRAGMENT: @@ -271,19 +271,19 @@ void Ent_DamageInfo(float isNew) ang = vectoangles(vel); RaptorCBShellfragToss(w_org, vel, ang + '0 0 1' * (120 * i)); } - sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); pointparticles(particleeffectnum("raptor_bomb_spread"), self.origin, w_backoff * 1000, 1); break; case DEATH_VH_RAPT_BOMB: - sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); pointparticles(particleeffectnum("raptor_bomb_impact"), self.origin, w_backoff * 1000, 1); break; case DEATH_VH_RAPT_DEATH: - sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTEN_MIN); + sound(self, CH_SHOTS, W_Sound("laserimpact"), VOL_BASE, ATTEN_MIN); pointparticles(particleeffectnum("explosion_big"), self.origin, w_backoff * 1000, 1); break; case DEATH_VH_BUMB_GUN: - sound(self, CH_SHOTS, "weapons/fireball_impact2.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, W_Sound("fireball_impact2"), VOL_BASE, ATTEN_NORM); pointparticles(particleeffectnum("bigplasma_impact"), self.origin, w_backoff * 1000, 1); break; } @@ -304,13 +304,13 @@ void Ent_DamageInfo(float isNew) switch(w_deathtype) { case DEATH_TURRET_EWHEEL: - sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTEN_MIN); + sound(self, CH_SHOTS, W_Sound("laserimpact"), VOL_BASE, ATTEN_MIN); pointparticles(particleeffectnum("laser_impact"), self.origin, w_backoff * 1000, 1); break; case DEATH_TURRET_FLAC: pointparticles(particleeffectnum("hagar_explode"), w_org, '0 0 0', 1); - _snd = strcat("weapons/hagexp", ftos(1 + rint(random() * 2)), ".waw"); + _snd = W_Sound(strcat("hagexp", ftos(1 + rint(random() * 2)))); sound(self, CH_SHOTS, _snd, VOL_BASE, ATTEN_NORM); break; @@ -318,24 +318,24 @@ void Ent_DamageInfo(float isNew) case DEATH_TURRET_HK: case DEATH_TURRET_WALK_ROCKET: case DEATH_TURRET_HELLION: - sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_MIN); + sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_MIN); pointparticles(particleeffectnum("rocket_explode"), self.origin, w_backoff * 1000, 1); break; case DEATH_TURRET_MACHINEGUN: case DEATH_TURRET_WALK_GUN: - _snd = strcat("weapons/ric", ftos(1 + rint(random() * 2)), ".waw"); + _snd = W_Sound(strcat("ric", ftos(1 + rint(random() * 2)))); sound(self, CH_SHOTS, _snd, VOL_BASE, ATTEN_NORM); pointparticles(particleeffectnum("machinegun_impact"), self.origin, w_backoff * 1000, 1); break; case DEATH_TURRET_PLASMA: - sound(self, CH_SHOTS, "weapons/electro_impact.wav", VOL_BASE, ATTEN_MIN); + sound(self, CH_SHOTS, W_Sound("electro_impact"), VOL_BASE, ATTEN_MIN); pointparticles(particleeffectnum("electro_impact"), self.origin, w_backoff * 1000, 1); break; case DEATH_TURRET_WALK_MELEE: - sound(self, CH_SHOTS, "weapons/ric1.wav", VOL_BASE, ATTEN_MIN); + sound(self, CH_SHOTS, W_Sound("ric1"), VOL_BASE, ATTEN_MIN); pointparticles(particleeffectnum("TE_SPARK"), self.origin, w_backoff * 1000, 1); break; diff --git a/qcsrc/client/generator.qc b/qcsrc/client/generator.qc index 0c2ce4681..ed4b35681 100644 --- a/qcsrc/client/generator.qc +++ b/qcsrc/client/generator.qc @@ -34,8 +34,8 @@ void generator_precache() precache_model("models/onslaught/ons_ray.md3"); precache_sound("onslaught/shockwave.wav"); - precache_sound("weapons/grenade_impact.wav"); - precache_sound("weapons/rocket_impact.wav"); + precache_sound(W_Sound("grenade_impact")); + precache_sound(W_Sound("rocket_impact")); precache_sound("onslaught/electricity_explode.wav"); generator_precached = true; @@ -132,7 +132,7 @@ void generator_draw() if(random() < 0.25) { te_explosion(self.origin); - sound(self, CH_TRIGGER, "weapons/grenade_impact.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_TRIGGER, W_Sound("grenade_impact"), VOL_BASE, ATTEN_NORM); } // Particles @@ -145,7 +145,7 @@ void generator_draw() org = self.origin; te_explosion(org); pointparticles(particleeffectnum("onslaught_generator_finalexplosion"), org, '0 0 0', 1); - sound(self, CH_TRIGGER, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_TRIGGER, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); } self.move_time = time + 0.05; diff --git a/qcsrc/client/hook.qc b/qcsrc/client/hook.qc index 2a9be2e0e..3da79866d 100644 --- a/qcsrc/client/hook.qc +++ b/qcsrc/client/hook.qc @@ -257,7 +257,7 @@ void Ent_ReadHook(float bIsNew, float type) self.drawmask = MASK_NORMAL; break; case ENT_CLIENT_ARC_BEAM: - sound (self, CH_SHOTS_SINGLE, "weapons/lgbeam_fly.wav", VOL_BASE, ATTEN_NORM); + sound (self, CH_SHOTS_SINGLE, W_Sound("lgbeam_fly"), VOL_BASE, ATTEN_NORM); break; } } @@ -267,7 +267,7 @@ void Ent_ReadHook(float bIsNew, float type) void Hook_Precache() { - precache_sound("weapons/lgbeam_fly.wav"); + precache_sound(W_Sound("lgbeam_fly")); precache_model("models/hook.md3"); } diff --git a/qcsrc/client/tuba.qc b/qcsrc/client/tuba.qc index b9f372db9..0b300d3b2 100644 --- a/qcsrc/client/tuba.qc +++ b/qcsrc/client/tuba.qc @@ -6,7 +6,7 @@ #include "../warpzonelib/mathlib.qh" -#define TUBA_STARTNOTE(i, n) strcat("weapons/tuba", (i ? ftos(i) : ""), "_loopnote", ftos(n), ".wav") +#define TUBA_STARTNOTE(i, n) W_Sound(strcat("tuba", (i ? ftos(i) : ""), "_loopnote", ftos(n))) const int TUBA_MIN = -18; const int TUBA_MAX = 27; diff --git a/qcsrc/client/weapons/projectile.qc b/qcsrc/client/weapons/projectile.qc index 1d0083e28..12f1714bf 100644 --- a/qcsrc/client/weapons/projectile.qc +++ b/qcsrc/client/weapons/projectile.qc @@ -315,7 +315,7 @@ void Ent_Projectile() case PROJECTILE_BUMBLE_GUN: setmodel(self, "models/elaser.mdl");self.traileffect = particleeffectnum("TR_NEXUIZPLASMA"); break; case PROJECTILE_BUMBLE_BEAM: setmodel(self, "models/elaser.mdl");self.traileffect = particleeffectnum("TR_NEXUIZPLASMA"); break; - case PROJECTILE_RPC: setmodel(self, "models/weapons/ok_rocket.md3");self.traileffect = particleeffectnum("TR_ROCKET"); break; + case PROJECTILE_RPC: setmodel(self, W_Model("ok_rocket"));self.traileffect = particleeffectnum("TR_ROCKET"); break; default: if(MUTATOR_CALLHOOK(Ent_Projectile, self)) @@ -323,7 +323,7 @@ void Ent_Projectile() if (Nade_FromProjectile(self.cnt) != NADE_TYPE_NULL) { - setmodel(self, "models/weapons/v_ok_grenade.md3"); + setmodel(self, W_Model("v_ok_grenade")); self.traileffect = particleeffectnum(Nade_TrailEffect(self.cnt, self.team)); break; } @@ -342,7 +342,7 @@ void Ent_Projectile() { case PROJECTILE_ELECTRO: // only new engines support sound moving with object - loopsound(self, CH_SHOTS_SINGLE, "weapons/electro_fly.wav", VOL_BASE, ATTEN_NORM); + loopsound(self, CH_SHOTS_SINGLE, W_Sound("electro_fly"), VOL_BASE, ATTEN_NORM); self.mins = '0 0 -4'; self.maxs = '0 0 -4'; self.move_movetype = MOVETYPE_BOUNCE; @@ -352,7 +352,7 @@ void Ent_Projectile() break; case PROJECTILE_RPC: case PROJECTILE_ROCKET: - loopsound(self, CH_SHOTS_SINGLE, "weapons/rocket_fly.wav", VOL_BASE, ATTEN_NORM); + loopsound(self, CH_SHOTS_SINGLE, W_Sound("rocket_fly"), VOL_BASE, ATTEN_NORM); self.mins = '-3 -3 -3'; self.maxs = '3 3 3'; break; @@ -400,12 +400,12 @@ void Ent_Projectile() break; case PROJECTILE_NAPALM_FOUNTAIN: case PROJECTILE_FIREBALL: - loopsound(self, CH_SHOTS_SINGLE, "weapons/fireball_fly2.wav", VOL_BASE, ATTEN_NORM); + loopsound(self, CH_SHOTS_SINGLE, W_Sound("fireball_fly2"), VOL_BASE, ATTEN_NORM); self.mins = '-16 -16 -16'; self.maxs = '16 16 16'; break; case PROJECTILE_FIREMINE: - loopsound(self, CH_SHOTS_SINGLE, "weapons/fireball_fly.wav", VOL_BASE, ATTEN_NORM); + loopsound(self, CH_SHOTS_SINGLE, W_Sound("fireball_fly"), VOL_BASE, ATTEN_NORM); self.move_movetype = MOVETYPE_BOUNCE; self.move_touch = func_null; self.mins = '-4 -4 -4'; @@ -420,7 +420,7 @@ void Ent_Projectile() self.maxs = '2 2 2'; break; case PROJECTILE_SEEKER: - loopsound(self, CH_SHOTS_SINGLE, "weapons/tag_rocket_fly.wav", VOL_BASE, ATTEN_NORM); + loopsound(self, CH_SHOTS_SINGLE, W_Sound("tag_rocket_fly"), VOL_BASE, ATTEN_NORM); self.mins = '-4 -4 -4'; self.maxs = '4 4 4'; break; @@ -433,17 +433,17 @@ void Ent_Projectile() case PROJECTILE_RAPTORCANNON: break; case PROJECTILE_SPIDERROCKET: - loopsound(self, CH_SHOTS_SINGLE, "weapons/tag_rocket_fly.wav", VOL_BASE, ATTEN_NORM); + loopsound(self, CH_SHOTS_SINGLE, W_Sound("tag_rocket_fly"), VOL_BASE, ATTEN_NORM); break; case PROJECTILE_WAKIROCKET: - loopsound(self, CH_SHOTS_SINGLE, "weapons/tag_rocket_fly.wav", VOL_BASE, ATTEN_NORM); + loopsound(self, CH_SHOTS_SINGLE, W_Sound("tag_rocket_fly"), VOL_BASE, ATTEN_NORM); break; /* case PROJECTILE_WAKICANNON: break; case PROJECTILE_BUMBLE_GUN: // only new engines support sound moving with object - loopsound(self, CH_SHOTS_SINGLE, "weapons/electro_fly.wav", VOL_BASE, ATTEN_NORM); + loopsound(self, CH_SHOTS_SINGLE, W_Sound("electro_fly"), VOL_BASE, ATTEN_NORM); self.mins = '0 0 -4'; self.maxs = '0 0 -4'; self.move_movetype = MOVETYPE_BOUNCE; @@ -516,14 +516,14 @@ void Projectile_Precache() precache_model("models/tracer.mdl"); precache_model("models/sphere/sphere.md3"); - precache_model("models/weapons/v_ok_grenade.md3"); - precache_model("models/weapons/ok_rocket.md3"); + precache_model(W_Model("v_ok_grenade")); + precache_model(W_Model("ok_rocket")); - precache_sound("weapons/electro_fly.wav"); - precache_sound("weapons/rocket_fly.wav"); - precache_sound("weapons/fireball_fly.wav"); - precache_sound("weapons/fireball_fly2.wav"); - precache_sound("weapons/tag_rocket_fly.wav"); + precache_sound(W_Sound("electro_fly")); + precache_sound(W_Sound("rocket_fly")); + precache_sound(W_Sound("fireball_fly")); + precache_sound(W_Sound("fireball_fly2")); + precache_sound(W_Sound("tag_rocket_fly")); MUTATOR_CALLHOOK(PrecacheProjectiles); } diff --git a/qcsrc/common/monsters/monster/mage.qc b/qcsrc/common/monsters/monster/mage.qc index f6dcb022e..e2258dbd4 100644 --- a/qcsrc/common/monsters/monster/mage.qc +++ b/qcsrc/common/monsters/monster/mage.qc @@ -400,7 +400,7 @@ float m_mage(float req) { precache_model("models/monsters/mage.dpm"); precache_sound (W_Sound("grenade_impact")); - precache_sound ("weapons/tagexp1.wav"); + precache_sound (W_Sound("tagexp1")); return true; } } diff --git a/qcsrc/common/turrets/cl_turrets.qc b/qcsrc/common/turrets/cl_turrets.qc index f0b3bdf0e..1e75506ab 100644 --- a/qcsrc/common/turrets/cl_turrets.qc +++ b/qcsrc/common/turrets/cl_turrets.qc @@ -272,7 +272,7 @@ void turret_gibboom() { float i; - sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM); + sound (self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1); for (i = 1; i < 5; i = i + 1) @@ -318,7 +318,7 @@ entity turret_gibtoss(string _model, vector _from, vector _to, vector _cmod, flo void turret_die() { - sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM); + sound (self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1); if (!autocvar_cl_nogibs) { diff --git a/qcsrc/common/turrets/turrets.qc b/qcsrc/common/turrets/turrets.qc index e37de95e6..46ecf5bf1 100644 --- a/qcsrc/common/turrets/turrets.qc +++ b/qcsrc/common/turrets/turrets.qc @@ -6,7 +6,7 @@ entity dummy_turret_info; void turrets_common_precache() { - precache_sound ("weapons/rocket_impact.wav"); + precache_sound (W_Sound("rocket_impact")); precache_model ("models/turrets/base-gib1.md3"); precache_model ("models/turrets/base-gib2.md3"); precache_model ("models/turrets/base-gib3.md3"); diff --git a/qcsrc/common/weapons/all.qc b/qcsrc/common/weapons/all.qc index 4dcb2d6e7..5ee9aaa3b 100644 --- a/qcsrc/common/weapons/all.qc +++ b/qcsrc/common/weapons/all.qc @@ -331,20 +331,22 @@ int GetAmmoStat(.int ammotype) } #endif -#ifdef SVQC string W_Sound(string w_snd) { string output = strcat("weapons/", w_snd, ".wav"); +#ifdef SVQC MUTATOR_CALLHOOK(WeaponSound, w_snd, output); +#endif return output; } string W_Model(string w_mdl) { string output = strcat("models/weapons/", w_mdl); +#ifdef SVQC MUTATOR_CALLHOOK(WeaponModel, w_mdl, output); +#endif return output; } -#endif #endif diff --git a/qcsrc/common/weapons/all.qh b/qcsrc/common/weapons/all.qh index e00b38c01..081e13a7e 100644 --- a/qcsrc/common/weapons/all.qh +++ b/qcsrc/common/weapons/all.qh @@ -90,10 +90,8 @@ string GetAmmoPicture(.int ammotype); int GetAmmoStat(.int ammotype); #endif -#ifdef SVQC string W_Sound(string w_snd); string W_Model(string w_mdl); -#endif // ammo types .int ammo_shells; @@ -214,11 +212,7 @@ CLASS(Weapon, Object) this.bot_pickupbasevalue = pickupbasevalue; this.wpcolor = clr; this.mdl = modelname; - #ifdef SVQC this.model = strzone(W_Model(strcat("g_", modelname, ".md3"))); - #elif defined(CSQC) - this.model = strzone(strcat("models/weapons/g_", modelname, ".md3")); - #endif this.w_simplemdl = strzone(simplemdl); // simpleitems weapon model/image this.w_crosshair = strzone(car(crosshair)); string s = cdr(crosshair); diff --git a/qcsrc/common/weapons/w_arc.qc b/qcsrc/common/weapons/w_arc.qc index 63a80c45e..893311441 100644 --- a/qcsrc/common/weapons/w_arc.qc +++ b/qcsrc/common/weapons/w_arc.qc @@ -1187,7 +1187,7 @@ void Ent_ReadArcBeam(float isnew) self.draw = Draw_ArcBeam; self.entremove = Remove_ArcBeam; self.move_time = time; - loopsound(self, CH_SHOTS_SINGLE, "weapons/arc_loop.wav", VOL_BASE, ATTEN_NORM); + loopsound(self, CH_SHOTS_SINGLE, W_Sound("arc_loop"), VOL_BASE, ATTEN_NORM); flash = spawn(); flash.owner = self; @@ -1531,7 +1531,7 @@ bool W_Arc(int req) } case WR_INIT: { - precache_sound("weapons/arc_loop.wav"); + precache_sound(W_Sound("arc_loop")); return true; } case WR_ZOOMRETICLE: diff --git a/qcsrc/common/weapons/w_blaster.qc b/qcsrc/common/weapons/w_blaster.qc index 85e78e7a8..23cb071ea 100644 --- a/qcsrc/common/weapons/w_blaster.qc +++ b/qcsrc/common/weapons/w_blaster.qc @@ -276,13 +276,13 @@ bool W_Blaster(int request) vector org2; org2 = w_org + w_backoff * 6; pointparticles(particleeffectnum("laser_impact"), org2, w_backoff * 1000, 1); - if(!w_issilent) { sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTN_NORM); } + if(!w_issilent) { sound(self, CH_SHOTS, W_Sound("laserimpact"), VOL_BASE, ATTN_NORM); } return true; } case WR_INIT: { - precache_sound("weapons/laserimpact.wav"); + precache_sound(W_Sound("laserimpact")); return true; } case WR_ZOOMRETICLE: diff --git a/qcsrc/common/weapons/w_crylink.qc b/qcsrc/common/weapons/w_crylink.qc index c688b8ef2..3c13a91db 100644 --- a/qcsrc/common/weapons/w_crylink.qc +++ b/qcsrc/common/weapons/w_crylink.qc @@ -702,21 +702,21 @@ bool W_Crylink(int req) { pointparticles(particleeffectnum("crylink_impact"), 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); 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: diff --git a/qcsrc/common/weapons/w_devastator.qc b/qcsrc/common/weapons/w_devastator.qc index 1591d2ed5..e79e38461 100644 --- a/qcsrc/common/weapons/w_devastator.qc +++ b/qcsrc/common/weapons/w_devastator.qc @@ -666,13 +666,13 @@ bool W_Devastator(int req) org2 = w_org + w_backoff * 12; pointparticles(particleeffectnum("rocket_explode"), org2, '0 0 0', 1); if(!w_issilent) - sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM); + sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTN_NORM); return true; } case WR_INIT: { - precache_sound("weapons/rocket_impact.wav"); + precache_sound(W_Sound("rocket_impact")); return true; } case WR_ZOOMRETICLE: diff --git a/qcsrc/common/weapons/w_electro.qc b/qcsrc/common/weapons/w_electro.qc index 2c614c771..bfe6edc32 100644 --- a/qcsrc/common/weapons/w_electro.qc +++ b/qcsrc/common/weapons/w_electro.qc @@ -582,7 +582,7 @@ bool W_Electro(int req) { pointparticles(particleeffectnum("electro_ballexplode"), org2, '0 0 0', 1); if(!w_issilent) - sound(self, CH_SHOTS, "weapons/electro_impact.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, W_Sound("electro_impact"), VOL_BASE, ATTEN_NORM); } else { @@ -591,13 +591,13 @@ bool W_Electro(int req) // this is sent as "primary (w_deathtype & HITTYPE_BOUNCE)" to distinguish it from (w_deathtype & HITTYPE_SECONDARY) bounced balls pointparticles(particleeffectnum("electro_combo"), org2, '0 0 0', 1); if(!w_issilent) - sound(self, CH_SHOTS, "weapons/electro_impact_combo.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, W_Sound("electro_impact_combo"), VOL_BASE, ATTEN_NORM); } else { pointparticles(particleeffectnum("electro_impact"), org2, '0 0 0', 1); if(!w_issilent) - sound(self, CH_SHOTS, "weapons/electro_impact.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, W_Sound("electro_impact"), VOL_BASE, ATTEN_NORM); } } @@ -605,8 +605,8 @@ bool W_Electro(int req) } case WR_INIT: { - precache_sound("weapons/electro_impact.wav"); - precache_sound("weapons/electro_impact_combo.wav"); + precache_sound(W_Sound("electro_impact")); + precache_sound(W_Sound("electro_impact_combo")); return true; } case WR_ZOOMRETICLE: diff --git a/qcsrc/common/weapons/w_fireball.qc b/qcsrc/common/weapons/w_fireball.qc index 7ea22e07f..5f426086f 100644 --- a/qcsrc/common/weapons/w_fireball.qc +++ b/qcsrc/common/weapons/w_fireball.qc @@ -464,14 +464,14 @@ bool W_Fireball(int req) org2 = w_org + w_backoff * 16; pointparticles(particleeffectnum("fireball_explode"), org2, '0 0 0', 1); if(!w_issilent) - sound(self, CH_SHOTS, "weapons/fireball_impact2.wav", VOL_BASE, ATTEN_NORM * 0.25); // long range boom + sound(self, CH_SHOTS, W_Sound("fireball_impact2"), VOL_BASE, ATTEN_NORM * 0.25); // long range boom } return true; } case WR_INIT: { - precache_sound("weapons/fireball_impact2.wav"); + precache_sound(W_Sound("fireball_impact2")); return true; } case WR_ZOOMRETICLE: diff --git a/qcsrc/common/weapons/w_hagar.qc b/qcsrc/common/weapons/w_hagar.qc index 2b1cb08c1..79c37abdc 100644 --- a/qcsrc/common/weapons/w_hagar.qc +++ b/qcsrc/common/weapons/w_hagar.qc @@ -535,20 +535,20 @@ bool W_Hagar(int req) if(!w_issilent) { if(w_random<0.15) - sound(self, CH_SHOTS, "weapons/hagexp1.wav", VOL_BASE, ATTN_NORM); + sound(self, CH_SHOTS, W_Sound("hagexp1"), VOL_BASE, ATTN_NORM); else if(w_random<0.7) - sound(self, CH_SHOTS, "weapons/hagexp2.wav", VOL_BASE, ATTN_NORM); + sound(self, CH_SHOTS, W_Sound("hagexp2"), VOL_BASE, ATTN_NORM); else - sound(self, CH_SHOTS, "weapons/hagexp3.wav", VOL_BASE, ATTN_NORM); + sound(self, CH_SHOTS, W_Sound("hagexp3"), VOL_BASE, ATTN_NORM); } return true; } case WR_INIT: { - precache_sound("weapons/hagexp1.wav"); - precache_sound("weapons/hagexp2.wav"); - precache_sound("weapons/hagexp3.wav"); + precache_sound(W_Sound("hagexp1")); + precache_sound(W_Sound("hagexp2")); + precache_sound(W_Sound("hagexp3")); return true; } case WR_ZOOMRETICLE: diff --git a/qcsrc/common/weapons/w_hlac.qc b/qcsrc/common/weapons/w_hlac.qc index d2428ffb4..ebcd5d2f1 100644 --- a/qcsrc/common/weapons/w_hlac.qc +++ b/qcsrc/common/weapons/w_hlac.qc @@ -293,13 +293,13 @@ bool W_HLAC(int req) org2 = w_org + w_backoff * 6; pointparticles(particleeffectnum("laser_impact"), org2, w_backoff * 1000, 1); if(!w_issilent) - sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTN_NORM); + sound(self, CH_SHOTS, W_Sound("laserimpact"), VOL_BASE, ATTN_NORM); return true; } case WR_INIT: { - precache_sound("weapons/laserimpact.wav"); + precache_sound(W_Sound("laserimpact")); return true; } case WR_ZOOMRETICLE: diff --git a/qcsrc/common/weapons/w_hmg.qc b/qcsrc/common/weapons/w_hmg.qc index 2c315f104..3af3a4864 100644 --- a/qcsrc/common/weapons/w_hmg.qc +++ b/qcsrc/common/weapons/w_hmg.qc @@ -181,19 +181,19 @@ bool W_HeavyMachineGun(int req) pointparticles(particleeffectnum("machinegun_impact"), org2, w_backoff * 1000, 1); if(!w_issilent) if(w_random < 0.05) - sound(self, CH_SHOTS, "weapons/ric1.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, W_Sound("ric1"), VOL_BASE, ATTEN_NORM); else if(w_random < 0.1) - sound(self, CH_SHOTS, "weapons/ric2.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, W_Sound("ric2"), VOL_BASE, ATTEN_NORM); else if(w_random < 0.2) - sound(self, CH_SHOTS, "weapons/ric3.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, W_Sound("ric3"), VOL_BASE, ATTEN_NORM); return true; } case WR_INIT: { - precache_sound("weapons/ric1.wav"); - precache_sound("weapons/ric2.wav"); - precache_sound("weapons/ric3.wav"); + precache_sound(W_Sound("ric1")); + precache_sound(W_Sound("ric2")); + precache_sound(W_Sound("ric3")); return true; } case WR_ZOOMRETICLE: diff --git a/qcsrc/common/weapons/w_hook.qc b/qcsrc/common/weapons/w_hook.qc index b877254c3..068805cf3 100644 --- a/qcsrc/common/weapons/w_hook.qc +++ b/qcsrc/common/weapons/w_hook.qc @@ -347,13 +347,13 @@ bool W_Hook(int req) org2 = w_org + w_backoff * 2; pointparticles(particleeffectnum("hookbomb_explode"), org2, '0 0 0', 1); if(!w_issilent) - sound(self, CH_SHOTS, "weapons/hookbomb_impact.wav", VOL_BASE, ATTN_NORM); + sound(self, CH_SHOTS, W_Sound("hookbomb_impact"), VOL_BASE, ATTN_NORM); return true; } case WR_INIT: { - precache_sound("weapons/hookbomb_impact.wav"); + precache_sound(W_Sound("hookbomb_impact")); return true; } case WR_ZOOMRETICLE: diff --git a/qcsrc/common/weapons/w_machinegun.qc b/qcsrc/common/weapons/w_machinegun.qc index ac5bc2cb3..cb87ad072 100644 --- a/qcsrc/common/weapons/w_machinegun.qc +++ b/qcsrc/common/weapons/w_machinegun.qc @@ -351,7 +351,7 @@ bool W_MachineGun(int req) } case WR_RELOAD: { - W_Reload(min(max(WEP_CVAR(machinegun, sustained_ammo), WEP_CVAR(machinegun, first_ammo)), WEP_CVAR(machinegun, burst_ammo)), "weapons/reload.wav"); + W_Reload(min(max(WEP_CVAR(machinegun, sustained_ammo), WEP_CVAR(machinegun, first_ammo)), WEP_CVAR(machinegun, burst_ammo)), W_Sound("reload")); return true; } case WR_SUICIDEMESSAGE: @@ -381,19 +381,19 @@ bool W_MachineGun(int req) pointparticles(particleeffectnum("machinegun_impact"), org2, w_backoff * 1000, 1); if(!w_issilent) if(w_random < 0.05) - sound(self, CH_SHOTS, "weapons/ric1.wav", VOL_BASE, ATTN_NORM); + sound(self, CH_SHOTS, W_Sound("ric1"), VOL_BASE, ATTN_NORM); else if(w_random < 0.1) - sound(self, CH_SHOTS, "weapons/ric2.wav", VOL_BASE, ATTN_NORM); + sound(self, CH_SHOTS, W_Sound("ric2"), VOL_BASE, ATTN_NORM); else if(w_random < 0.2) - sound(self, CH_SHOTS, "weapons/ric3.wav", VOL_BASE, ATTN_NORM); + sound(self, CH_SHOTS, W_Sound("ric3"), VOL_BASE, ATTN_NORM); return true; } case WR_INIT: { - precache_sound("weapons/ric1.wav"); - precache_sound("weapons/ric2.wav"); - precache_sound("weapons/ric3.wav"); + precache_sound(W_Sound("ric1")); + precache_sound(W_Sound("ric2")); + precache_sound(W_Sound("ric3")); return true; } case WR_ZOOMRETICLE: diff --git a/qcsrc/common/weapons/w_minelayer.qc b/qcsrc/common/weapons/w_minelayer.qc index 61ae5362a..d8f0a48e3 100644 --- a/qcsrc/common/weapons/w_minelayer.qc +++ b/qcsrc/common/weapons/w_minelayer.qc @@ -602,13 +602,13 @@ bool W_MineLayer(int req) org2 = w_org + w_backoff * 12; pointparticles(particleeffectnum("rocket_explode"), org2, '0 0 0', 1); if(!w_issilent) - sound(self, CH_SHOTS, "weapons/mine_exp.wav", VOL_BASE, ATTN_NORM); + sound(self, CH_SHOTS, W_Sound("mine_exp"), VOL_BASE, ATTN_NORM); return true; } case WR_INIT: { - precache_sound("weapons/mine_exp.wav"); + precache_sound(W_Sound("mine_exp")); return true; } case WR_ZOOMRETICLE: diff --git a/qcsrc/common/weapons/w_mortar.qc b/qcsrc/common/weapons/w_mortar.qc index 1bea5edf7..64bd3d97c 100644 --- a/qcsrc/common/weapons/w_mortar.qc +++ b/qcsrc/common/weapons/w_mortar.qc @@ -470,13 +470,13 @@ bool W_Mortar(int req) org2 = w_org + w_backoff * 12; pointparticles(particleeffectnum("grenade_explode"), org2, '0 0 0', 1); if(!w_issilent) - sound(self, CH_SHOTS, "weapons/grenade_impact.wav", VOL_BASE, ATTN_NORM); + sound(self, CH_SHOTS, W_Sound("grenade_impact"), VOL_BASE, ATTN_NORM); return true; } case WR_INIT: { - precache_sound("weapons/grenade_impact.wav"); + precache_sound(W_Sound("grenade_impact")); return true; } case WR_ZOOMRETICLE: diff --git a/qcsrc/common/weapons/w_rifle.qc b/qcsrc/common/weapons/w_rifle.qc index 687a20cf4..a879bf342 100644 --- a/qcsrc/common/weapons/w_rifle.qc +++ b/qcsrc/common/weapons/w_rifle.qc @@ -277,20 +277,20 @@ bool W_Rifle(int req) if(!w_issilent) { if(w_random < 0.2) - sound(self, CH_SHOTS, "weapons/ric1.wav", VOL_BASE, ATTN_NORM); + sound(self, CH_SHOTS, W_Sound("ric1"), VOL_BASE, ATTN_NORM); else if(w_random < 0.4) - sound(self, CH_SHOTS, "weapons/ric2.wav", VOL_BASE, ATTN_NORM); + sound(self, CH_SHOTS, W_Sound("ric2"), VOL_BASE, ATTN_NORM); else if(w_random < 0.5) - sound(self, CH_SHOTS, "weapons/ric3.wav", VOL_BASE, ATTN_NORM); + sound(self, CH_SHOTS, W_Sound("ric3"), VOL_BASE, ATTN_NORM); } return true; } case WR_INIT: { - precache_sound("weapons/ric1.wav"); - precache_sound("weapons/ric2.wav"); - precache_sound("weapons/ric3.wav"); + precache_sound(W_Sound("ric1")); + precache_sound(W_Sound("ric2")); + precache_sound(W_Sound("ric3")); if(autocvar_cl_reticle && autocvar_cl_reticle_weapon) { precache_pic("gfx/reticle_nex"); diff --git a/qcsrc/common/weapons/w_rpc.qc b/qcsrc/common/weapons/w_rpc.qc index f879fdd64..de051d987 100644 --- a/qcsrc/common/weapons/w_rpc.qc +++ b/qcsrc/common/weapons/w_rpc.qc @@ -243,13 +243,13 @@ bool W_RocketPropelledChainsaw(int req) org2 = w_org + w_backoff * 12; pointparticles(particleeffectnum("rocket_explode"), org2, '0 0 0', 1); if(!w_issilent) - sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); return true; } case WR_INIT: { - precache_sound("weapons/rocket_impact.wav"); + precache_sound(W_Sound("rocket_impact")); return true; } case WR_ZOOMRETICLE: diff --git a/qcsrc/common/weapons/w_seeker.qc b/qcsrc/common/weapons/w_seeker.qc index f94984daa..8d8a24194 100644 --- a/qcsrc/common/weapons/w_seeker.qc +++ b/qcsrc/common/weapons/w_seeker.qc @@ -739,7 +739,7 @@ bool W_Seeker(int req) if(w_deathtype & HITTYPE_SECONDARY) { if(!w_issilent) - sound(self, CH_SHOTS, "weapons/tag_impact.wav", 1, ATTEN_NORM); + sound(self, CH_SHOTS, W_Sound("tag_impact"), 1, ATTEN_NORM); } else { @@ -747,11 +747,11 @@ bool W_Seeker(int req) if(!w_issilent) { if(w_random<0.15) - sound(self, CH_SHOTS, "weapons/tagexp1.wav", 1, ATTEN_NORM); + sound(self, CH_SHOTS, W_Sound("tagexp1"), 1, ATTEN_NORM); else if(w_random<0.7) - sound(self, CH_SHOTS, "weapons/tagexp2.wav", 1, ATTEN_NORM); + sound(self, CH_SHOTS, W_Sound("tagexp2"), 1, ATTEN_NORM); else - sound(self, CH_SHOTS, "weapons/tagexp3.wav", 1, ATTEN_NORM); + sound(self, CH_SHOTS, W_Sound("tagexp3"), 1, ATTEN_NORM); } } } @@ -761,24 +761,24 @@ bool W_Seeker(int req) if(!w_issilent) { if(w_random<0.15) - sound(self, CH_SHOTS, "weapons/seekerexp1.wav", 1, ATTEN_NORM); + sound(self, CH_SHOTS, W_Sound("seekerexp1"), 1, ATTEN_NORM); else if(w_random<0.7) - sound(self, CH_SHOTS, "weapons/seekerexp2.wav", 1, ATTEN_NORM); + sound(self, CH_SHOTS, W_Sound("seekerexp2"), 1, ATTEN_NORM); else - sound(self, CH_SHOTS, "weapons/seekerexp3.wav", 1, ATTEN_NORM); + sound(self, CH_SHOTS, W_Sound("seekerexp3"), 1, ATTEN_NORM); } } return true; } case WR_INIT: { - precache_sound("weapons/seekerexp1.wav"); - precache_sound("weapons/seekerexp2.wav"); - precache_sound("weapons/seekerexp3.wav"); - precache_sound("weapons/tagexp1.wav"); - precache_sound("weapons/tagexp2.wav"); - precache_sound("weapons/tagexp3.wav"); - precache_sound("weapons/tag_impact.wav"); + precache_sound(W_Sound("seekerexp1")); + precache_sound(W_Sound("seekerexp2")); + precache_sound(W_Sound("seekerexp3")); + precache_sound(W_Sound("tagexp1")); + precache_sound(W_Sound("tagexp2")); + precache_sound(W_Sound("tagexp3")); + precache_sound(W_Sound("tag_impact")); return true; } case WR_ZOOMRETICLE: diff --git a/qcsrc/common/weapons/w_shockwave.qc b/qcsrc/common/weapons/w_shockwave.qc index 1c5d080d3..40faf0402 100644 --- a/qcsrc/common/weapons/w_shockwave.qc +++ b/qcsrc/common/weapons/w_shockwave.qc @@ -879,9 +879,9 @@ bool W_Shockwave(int req) } case WR_INIT: { - //precache_sound("weapons/ric1.wav"); - //precache_sound("weapons/ric2.wav"); - //precache_sound("weapons/ric3.wav"); + //precache_sound(W_Sound("ric1")); + //precache_sound(W_Sound("ric2")); + //precache_sound(W_Sound("ric3")); return false; } case WR_ZOOMRETICLE: diff --git a/qcsrc/common/weapons/w_shotgun.qc b/qcsrc/common/weapons/w_shotgun.qc index 76738a98a..1c20423df 100644 --- a/qcsrc/common/weapons/w_shotgun.qc +++ b/qcsrc/common/weapons/w_shotgun.qc @@ -363,11 +363,11 @@ float W_Shotgun(float req) if(!w_issilent && time - self.prevric > 0.25) { if(w_random < 0.0165) - sound(self, CH_SHOTS, "weapons/ric1.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, W_Sound("ric1"), VOL_BASE, ATTEN_NORM); else if(w_random < 0.033) - sound(self, CH_SHOTS, "weapons/ric2.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, W_Sound("ric2"), VOL_BASE, ATTEN_NORM); else if(w_random < 0.05) - sound(self, CH_SHOTS, "weapons/ric3.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_SHOTS, W_Sound("ric3"), VOL_BASE, ATTEN_NORM); self.prevric = time; } @@ -375,9 +375,9 @@ float W_Shotgun(float req) } case WR_INIT: { - precache_sound("weapons/ric1.wav"); - precache_sound("weapons/ric2.wav"); - precache_sound("weapons/ric3.wav"); + precache_sound(W_Sound("ric1")); + precache_sound(W_Sound("ric2")); + precache_sound(W_Sound("ric3")); return true; } case WR_ZOOMRETICLE: diff --git a/qcsrc/common/weapons/w_vaporizer.qc b/qcsrc/common/weapons/w_vaporizer.qc index 9e4f08d40..c5dd7826b 100644 --- a/qcsrc/common/weapons/w_vaporizer.qc +++ b/qcsrc/common/weapons/w_vaporizer.qc @@ -267,19 +267,19 @@ float W_Vaporizer(float req) if(w_deathtype & HITTYPE_SECONDARY) { pointparticles(particleeffectnum("laser_impact"), org2, w_backoff * 1000, 1); - if(!w_issilent) { sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTN_NORM); } + if(!w_issilent) { sound(self, CH_SHOTS, W_Sound("laserimpact"), VOL_BASE, ATTN_NORM); } } else { pointparticles(particleeffectnum("nex_impact"), org2, '0 0 0', 1); - if(!w_issilent) { sound(self, CH_SHOTS, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM); } + if(!w_issilent) { sound(self, CH_SHOTS, W_Sound("neximpact"), VOL_BASE, ATTN_NORM); } } return true; } case WR_INIT: { - precache_sound("weapons/laserimpact.wav"); - precache_sound("weapons/neximpact.wav"); + precache_sound(W_Sound("laserimpact")); + precache_sound(W_Sound("neximpact")); if(autocvar_cl_reticle && autocvar_cl_reticle_weapon) { precache_pic("gfx/reticle_nex"); diff --git a/qcsrc/common/weapons/w_vortex.qc b/qcsrc/common/weapons/w_vortex.qc index 616bf89d7..d47cebde4 100644 --- a/qcsrc/common/weapons/w_vortex.qc +++ b/qcsrc/common/weapons/w_vortex.qc @@ -329,13 +329,13 @@ bool W_Vortex(int req) org2 = w_org + w_backoff * 6; pointparticles(particleeffectnum("nex_impact"), org2, '0 0 0', 1); if(!w_issilent) - sound(self, CH_SHOTS, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM); + sound(self, CH_SHOTS, W_Sound("neximpact"), VOL_BASE, ATTN_NORM); return true; } case WR_INIT: { - precache_sound("weapons/neximpact.wav"); + precache_sound(W_Sound("neximpact")); if(autocvar_cl_reticle && autocvar_cl_reticle_weapon) { precache_pic("gfx/reticle_nex");