From fb4de10baa184b2228b92776b58b2c272120d04b Mon Sep 17 00:00:00 2001 From: TimePath Date: Fri, 30 Oct 2015 17:02:50 +1100 Subject: [PATCH] Effects: make sending entities easier, make sending server ids harder --- qcsrc/client/csqcmodel_hooks.qc | 4 +- qcsrc/client/damage.qc | 36 ++++----- qcsrc/client/generator.qc | 12 +-- qcsrc/client/gibs.qc | 14 ++-- qcsrc/client/hook.qc | 2 +- qcsrc/client/main.qc | 12 +-- qcsrc/client/particles.qc | 2 +- qcsrc/common/effects/all.qc | 4 +- qcsrc/common/effects/effect.qh | 16 +++- qcsrc/common/triggers/func/breakable.qc | 2 +- qcsrc/common/triggers/func/pointparticles.qc | 4 +- qcsrc/common/triggers/misc/laser.qc | 2 +- qcsrc/common/turrets/cl_turrets.qc | 8 +- qcsrc/common/vehicles/sv_vehicles.qc | 2 +- qcsrc/common/vehicles/vehicle/racer.qc | 4 +- qcsrc/common/vehicles/vehicle/spiderbot.qc | 2 +- qcsrc/common/weapons/weapon/arc.qc | 78 +++++++++---------- qcsrc/common/weapons/weapon/blaster.qc | 2 +- qcsrc/common/weapons/weapon/crylink.qc | 4 +- qcsrc/common/weapons/weapon/devastator.qc | 2 +- qcsrc/common/weapons/weapon/electro.qc | 6 +- qcsrc/common/weapons/weapon/fireball.qc | 2 +- qcsrc/common/weapons/weapon/hagar.qc | 2 +- qcsrc/common/weapons/weapon/hlac.qc | 2 +- qcsrc/common/weapons/weapon/hmg.qc | 2 +- qcsrc/common/weapons/weapon/hook.qc | 2 +- qcsrc/common/weapons/weapon/machinegun.qc | 2 +- qcsrc/common/weapons/weapon/minelayer.qc | 2 +- qcsrc/common/weapons/weapon/mortar.qc | 2 +- qcsrc/common/weapons/weapon/rifle.qc | 2 +- qcsrc/common/weapons/weapon/rpc.qc | 2 +- qcsrc/common/weapons/weapon/seeker.qc | 4 +- qcsrc/common/weapons/weapon/shockwave.qc | 2 +- qcsrc/common/weapons/weapon/shotgun.qc | 2 +- qcsrc/common/weapons/weapon/vaporizer.qc | 4 +- qcsrc/common/weapons/weapon/vortex.qc | 2 +- qcsrc/dpdefs/csprogsdefs.qh | 4 + qcsrc/dpdefs/dpextensions.qh | 4 + qcsrc/lib/warpzone/common.qc | 2 +- qcsrc/server/cheats.qc | 2 +- qcsrc/server/command/sv_cmd.qc | 4 +- .../mutators/mutator/gamemode_onslaught.qc | 4 +- qcsrc/server/weapons/tracing.qc | 6 +- qcsrc/server/weapons/tracing.qh | 2 +- 44 files changed, 151 insertions(+), 129 deletions(-) diff --git a/qcsrc/client/csqcmodel_hooks.qc b/qcsrc/client/csqcmodel_hooks.qc index e2e0e9341..807ebe4e5 100644 --- a/qcsrc/client/csqcmodel_hooks.qc +++ b/qcsrc/client/csqcmodel_hooks.qc @@ -532,9 +532,9 @@ void CSQCModel_Effects_Apply(void) if(eff & EF_FULLBRIGHT) self.renderflags |= RF_FULLBRIGHT; if(eff & EF_FLAME) - pointparticles(particleeffectnum(EFFECT_EF_FLAME), self.origin, '0 0 0', bound(0, frametime, 0.1)); + pointparticles(EFFECT_EF_FLAME, self.origin, '0 0 0', bound(0, frametime, 0.1)); if(eff & EF_STARDUST) - pointparticles(particleeffectnum(EFFECT_EF_STARDUST), self.origin, '0 0 0', bound(0, frametime, 0.1)); + pointparticles(EFFECT_EF_STARDUST, self.origin, '0 0 0', bound(0, frametime, 0.1)); if(eff & EF_NOSHADOW) self.renderflags |= RF_NOSHADOW; if(eff & EF_NODEPTHTEST) diff --git a/qcsrc/client/damage.qc b/qcsrc/client/damage.qc index 34890e034..803b241d0 100644 --- a/qcsrc/client/damage.qc +++ b/qcsrc/client/damage.qc @@ -42,7 +42,7 @@ void DamageEffect_Think() // now generate the particles vector org; org = gettaginfo(self, 0); // origin at attached location - pointparticles(self.team, org, '0 0 0', 1); + __pointparticles(self.team, org, '0 0 0', 1); } void DamageEffect(vector hitorg, float thedamage, int type, int specnum) @@ -222,33 +222,33 @@ void Ent_DamageInfo(float isNew) // spiderbot case DEATH_VH_SPID_MINIGUN: sound(self, CH_SHOTS, SND_RIC_RANDOM(), VOL_BASE, ATTEN_NORM); - pointparticles(particleeffectnum(EFFECT_SPIDERBOT_MINIGUN_IMPACT), self.origin, w_backoff * 1000, 1); + pointparticles(EFFECT_SPIDERBOT_MINIGUN_IMPACT, self.origin, w_backoff * 1000, 1); break; case DEATH_VH_SPID_ROCKET: sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM); - pointparticles(particleeffectnum(EFFECT_SPIDERBOT_ROCKET_EXPLODE), self.origin, w_backoff * 1000, 1); + pointparticles(EFFECT_SPIDERBOT_ROCKET_EXPLODE, self.origin, w_backoff * 1000, 1); break; case DEATH_VH_SPID_DEATH: sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_MIN); - pointparticles(particleeffectnum(EFFECT_EXPLOSION_BIG), self.origin, w_backoff * 1000, 1); + pointparticles(EFFECT_EXPLOSION_BIG, self.origin, w_backoff * 1000, 1); break; case DEATH_VH_WAKI_GUN: sound(self, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTEN_NORM); - pointparticles(particleeffectnum(EFFECT_RACER_IMPACT), self.origin, w_backoff * 1000, 1); + pointparticles(EFFECT_RACER_IMPACT, self.origin, w_backoff * 1000, 1); break; case DEATH_VH_WAKI_ROCKET: sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM); - pointparticles(particleeffectnum(EFFECT_RACER_ROCKET_EXPLODE), self.origin, w_backoff * 1000, 1); + pointparticles(EFFECT_RACER_ROCKET_EXPLODE, self.origin, w_backoff * 1000, 1); break; case DEATH_VH_WAKI_DEATH: sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_MIN); - pointparticles(particleeffectnum(EFFECT_EXPLOSION_BIG), self.origin, w_backoff * 1000, 1); + pointparticles(EFFECT_EXPLOSION_BIG, self.origin, w_backoff * 1000, 1); break; case DEATH_VH_RAPT_CANNON: sound(self, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTEN_NORM); - pointparticles(particleeffectnum(EFFECT_RAPTOR_CANNON_IMPACT), self.origin, w_backoff * 1000, 1); + pointparticles(EFFECT_RAPTOR_CANNON_IMPACT, self.origin, w_backoff * 1000, 1); break; case DEATH_VH_RAPT_FRAGMENT: float i; @@ -260,19 +260,19 @@ void Ent_DamageInfo(float isNew) RaptorCBShellfragToss(w_org, vel, ang + '0 0 1' * (120 * i)); } sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM); - pointparticles(particleeffectnum(EFFECT_RAPTOR_BOMB_SPREAD), self.origin, w_backoff * 1000, 1); + pointparticles(EFFECT_RAPTOR_BOMB_SPREAD, self.origin, w_backoff * 1000, 1); break; case DEATH_VH_RAPT_BOMB: sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM); - pointparticles(particleeffectnum(EFFECT_RAPTOR_BOMB_IMPACT), self.origin, w_backoff * 1000, 1); + pointparticles(EFFECT_RAPTOR_BOMB_IMPACT, self.origin, w_backoff * 1000, 1); break; case DEATH_VH_RAPT_DEATH: sound(self, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTEN_MIN); - pointparticles(particleeffectnum(EFFECT_EXPLOSION_BIG), self.origin, w_backoff * 1000, 1); + pointparticles(EFFECT_EXPLOSION_BIG, self.origin, w_backoff * 1000, 1); break; case DEATH_VH_BUMB_GUN: sound(self, CH_SHOTS, SND_FIREBALL_IMPACT2, VOL_BASE, ATTEN_NORM); - pointparticles(particleeffectnum(EFFECT_BIGPLASMA_IMPACT), self.origin, w_backoff * 1000, 1); + pointparticles(EFFECT_BIGPLASMA_IMPACT, self.origin, w_backoff * 1000, 1); break; } } @@ -292,11 +292,11 @@ void Ent_DamageInfo(float isNew) { case DEATH_TURRET_EWHEEL: sound(self, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTEN_MIN); - pointparticles(particleeffectnum(EFFECT_BLASTER_IMPACT), self.origin, w_backoff * 1000, 1); + pointparticles(EFFECT_BLASTER_IMPACT, self.origin, w_backoff * 1000, 1); break; case DEATH_TURRET_FLAC: - pointparticles(particleeffectnum(EFFECT_HAGAR_EXPLODE), w_org, '0 0 0', 1); + pointparticles(EFFECT_HAGAR_EXPLODE, w_org, '0 0 0', 1); sound(self, CH_SHOTS, SND_HAGEXP_RANDOM(), VOL_BASE, ATTEN_NORM); break; @@ -305,23 +305,23 @@ void Ent_DamageInfo(float isNew) case DEATH_TURRET_WALK_ROCKET: case DEATH_TURRET_HELLION: sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_MIN); - pointparticles(particleeffectnum(EFFECT_ROCKET_EXPLODE), self.origin, w_backoff * 1000, 1); + pointparticles(EFFECT_ROCKET_EXPLODE, self.origin, w_backoff * 1000, 1); break; case DEATH_TURRET_MACHINEGUN: case DEATH_TURRET_WALK_GUN: sound(self, CH_SHOTS, SND_RIC_RANDOM(), VOL_BASE, ATTEN_NORM); - pointparticles(particleeffectnum(EFFECT_MACHINEGUN_IMPACT), self.origin, w_backoff * 1000, 1); + pointparticles(EFFECT_MACHINEGUN_IMPACT, self.origin, w_backoff * 1000, 1); break; case DEATH_TURRET_PLASMA: sound(self, CH_SHOTS, SND_ELECTRO_IMPACT, VOL_BASE, ATTEN_MIN); - pointparticles(particleeffectnum(EFFECT_ELECTRO_IMPACT), self.origin, w_backoff * 1000, 1); + pointparticles(EFFECT_ELECTRO_IMPACT, self.origin, w_backoff * 1000, 1); break; case DEATH_TURRET_WALK_MELEE: sound(self, CH_SHOTS, SND_RIC1, VOL_BASE, ATTEN_MIN); - pointparticles(particleeffectnum(EFFECT_TE_SPARK), self.origin, w_backoff * 1000, 1); + pointparticles(EFFECT_TE_SPARK, self.origin, w_backoff * 1000, 1); break; case DEATH_TURRET_PHASER: diff --git a/qcsrc/client/generator.qc b/qcsrc/client/generator.qc index d7114d1bf..77e1c545a 100644 --- a/qcsrc/client/generator.qc +++ b/qcsrc/client/generator.qc @@ -58,11 +58,11 @@ void generator_draw(entity this) if(random() < 0.9 - self.health / self.max_health) if(random() < 0.01) { - pointparticles(particleeffectnum(EFFECT_ELECTRO_BALLEXPLODE), self.origin + randompos('-50 -50 -20', '50 50 50'), '0 0 0', 1); + pointparticles(EFFECT_ELECTRO_BALLEXPLODE, self.origin + randompos('-50 -50 -20', '50 50 50'), '0 0 0', 1); sound(self, CH_TRIGGER, SND_ONS_ELECTRICITY_EXPLODE, VOL_BASE, ATTEN_NORM); } else - pointparticles(particleeffectnum(EFFECT_ONS_GENERATOR_DAMAGED), self.origin + randompos('-60 -60 -20', '60 60 60'), '0 0 0', 1); + pointparticles(EFFECT_ONS_GENERATOR_DAMAGED, self.origin + randompos('-60 -60 -20', '60 60 60'), '0 0 0', 1); self.move_time = time + 0.1; @@ -79,7 +79,7 @@ void generator_draw(entity this) if(self.count==40||self.count==20) { sound(self, CH_TRIGGER, SND_ONS_SHOCKWAVE, VOL_BASE, ATTEN_NORM); - pointparticles(particleeffectnum(EFFECT_ELECTRO_COMBO), self.origin, '0 0 0', 6); + pointparticles(EFFECT_ELECTRO_COMBO, self.origin, '0 0 0', 6); } // rays @@ -92,7 +92,7 @@ void generator_draw(entity this) for(i=0;i < 10;++i) { org = self.origin + randompos('-30 -30 -30' * i + '0 0 -20', '30 30 30' * i + '0 0 20'); - pointparticles(particleeffectnum(EFFECT_ONS_GENERATOR_GIB), org, '0 0 0', 1); + pointparticles(EFFECT_ONS_GENERATOR_GIB, org, '0 0 0', 1); } // Short explosion sound + small explosion @@ -104,14 +104,14 @@ void generator_draw(entity this) // Particles org = self.origin + randompos(self.mins + '8 8 8', self.maxs + '-8 -8 -8'); - pointparticles(particleeffectnum(EFFECT_ONS_GENERATOR_EXPLODE), org, '0 0 0', 1); + pointparticles(EFFECT_ONS_GENERATOR_EXPLODE, org, '0 0 0', 1); // Final explosion if(self.count==1) { org = self.origin; te_explosion(org); - pointparticles(particleeffectnum(EFFECT_ONS_GENERATOR_EXPLODE2), org, '0 0 0', 1); + pointparticles(EFFECT_ONS_GENERATOR_EXPLODE2, org, '0 0 0', 1); sound(self, CH_TRIGGER, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM); } diff --git a/qcsrc/client/gibs.qc b/qcsrc/client/gibs.qc index 4afa5eb88..6b27d0a41 100644 --- a/qcsrc/client/gibs.qc +++ b/qcsrc/client/gibs.qc @@ -61,7 +61,7 @@ void new_te_bloodshower (int ef, vector org, float explosionspeed, int howmany) float i, pmod; pmod = autocvar_cl_particles_quality; for (i = 0; i < 50 * pmod; ++i) - pointparticles(ef, org, randomvec() * explosionspeed, howmany / 50); + __pointparticles(ef, org, randomvec() * explosionspeed, howmany / 50); } void SUB_RemoveOnNoImpact() @@ -82,7 +82,7 @@ void Gib_Touch() if(!self.silent) sound(self, CH_PAIN, SND_GIB_SPLAT_RANDOM(), VOL_BASE, ATTEN_NORM); - pointparticles(_particleeffectnum(strcat(species_prefix(self.cnt), "blood")), self.origin + '0 0 1', '0 0 30', 10); + __pointparticles(_particleeffectnum(strcat(species_prefix(self.cnt), "blood")), self.origin + '0 0 1', '0 0 30', 10); Gib_Delete(); } @@ -98,9 +98,9 @@ void Gib_Draw(entity this) if(self.touch == Gib_Touch) // don't do this for the "chunk" thingie... // TODO somehow make it spray in a direction dependent on self.angles - trailparticles(self, _particleeffectnum(strcat(species_prefix(self.cnt), EFFECT_TR_SLIGHTBLOOD.eent_eff_name)), oldorg, self.origin); + __trailparticles(self, _particleeffectnum(strcat(species_prefix(self.cnt), EFFECT_TR_SLIGHTBLOOD.eent_eff_name)), oldorg, self.origin); else - trailparticles(self, _particleeffectnum(strcat(species_prefix(self.cnt), EFFECT_TR_BLOOD.eent_eff_name)), oldorg, self.origin); + __trailparticles(self, _particleeffectnum(strcat(species_prefix(self.cnt), EFFECT_TR_BLOOD.eent_eff_name)), oldorg, self.origin); self.renderflags = 0; @@ -251,17 +251,17 @@ void Ent_GibSplash(bool isNew) } break; case 0x02: - pointparticles(_particleeffectnum(strcat(specstr, "blood")), org, vel, amount * 16); + __pointparticles(_particleeffectnum(strcat(specstr, "blood")), org, vel, amount * 16); break; case 0x03: if(prandom() < amount) TossGib ("models/gibs/chunk.mdl", org, org, vel, prandomvec() * (prandom() * 30 + 20), specnum, 1, issilent); // TODO maybe adjust to more randomization? break; case 0x81: - pointparticles(_particleeffectnum(strcat(gentle_prefix, "damage_dissolve")), org, vel, amount); + __pointparticles(_particleeffectnum(strcat(gentle_prefix, "damage_dissolve")), org, vel, amount); break; case 0x82: - pointparticles(_particleeffectnum(strcat(gentle_prefix, "damage_hit")), org, vel, amount * 16); + __pointparticles(_particleeffectnum(strcat(gentle_prefix, "damage_hit")), org, vel, amount * 16); break; case 0x83: // no gibs in gentle mode, sorry diff --git a/qcsrc/client/hook.qc b/qcsrc/client/hook.qc index 5b8d09312..eb5cc8dd1 100644 --- a/qcsrc/client/hook.qc +++ b/qcsrc/client/hook.qc @@ -152,7 +152,7 @@ void Draw_GrapplingHook(entity this) case ENT_CLIENT_HOOK: break; case ENT_CLIENT_ARC_BEAM: - pointparticles(particleeffectnum(EFFECT_ARC_LIGHTNING2), trace_endpos, normalize(atrans - trace_endpos), frametime * intensity); // todo: new effect + pointparticles(EFFECT_ARC_LIGHTNING2, trace_endpos, normalize(atrans - trace_endpos), frametime * intensity); // todo: new effect break; } } diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index 9d20c4061..ac3d8f2ae 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -662,7 +662,7 @@ void Ent_ReadAccuracy() void Spawn_Draw(entity this) { - pointparticles(this.cnt, this.origin + '0 0 28', '0 0 2', bound(0, frametime, 0.1)); + __pointparticles(this.cnt, this.origin + '0 0 28', '0 0 2', bound(0, frametime, 0.1)); } void Ent_ReadSpawnPoint(float is_new) // entity for spawnpoint @@ -732,11 +732,11 @@ void Ent_ReadSpawnEvent(float is_new) { switch(teamnum) { - case NUM_TEAM_1: pointparticles(particleeffectnum(EFFECT_SPAWN_RED), self.origin, '0 0 0', 1); break; - case NUM_TEAM_2: pointparticles(particleeffectnum(EFFECT_SPAWN_BLUE), self.origin, '0 0 0', 1); break; - case NUM_TEAM_3: pointparticles(particleeffectnum(EFFECT_SPAWN_YELLOW), self.origin, '0 0 0', 1); break; - case NUM_TEAM_4: pointparticles(particleeffectnum(EFFECT_SPAWN_PINK), self.origin, '0 0 0', 1); break; - default: pointparticles(particleeffectnum(EFFECT_SPAWN_NEUTRAL), self.origin, '0 0 0', 1); break; + case NUM_TEAM_1: pointparticles(EFFECT_SPAWN_RED, self.origin, '0 0 0', 1); break; + case NUM_TEAM_2: pointparticles(EFFECT_SPAWN_BLUE, self.origin, '0 0 0', 1); break; + case NUM_TEAM_3: pointparticles(EFFECT_SPAWN_YELLOW, self.origin, '0 0 0', 1); break; + case NUM_TEAM_4: pointparticles(EFFECT_SPAWN_PINK, self.origin, '0 0 0', 1); break; + default: pointparticles(EFFECT_SPAWN_NEUTRAL, self.origin, '0 0 0', 1); break; } } if(autocvar_cl_spawn_event_sound) diff --git a/qcsrc/client/particles.qc b/qcsrc/client/particles.qc index 0c7f7a39f..9fcc4bd53 100644 --- a/qcsrc/client/particles.qc +++ b/qcsrc/client/particles.qc @@ -12,7 +12,7 @@ void Net_ReadVortexBeamParticle() endpos.x = ReadCoord(); endpos.y = ReadCoord(); endpos.z = ReadCoord(); charge = ReadByte() / 255.0; - pointparticles(particleeffectnum(EFFECT_VORTEX_MUZZLEFLASH), shotorg, normalize(endpos - shotorg) * 1000, 1); + pointparticles(EFFECT_VORTEX_MUZZLEFLASH, shotorg, normalize(endpos - shotorg) * 1000, 1); //draw either the old v2.3 beam or the new beam charge = sqrt(charge); // divide evenly among trail spacing and alpha diff --git a/qcsrc/common/effects/all.qc b/qcsrc/common/effects/all.qc index e90f3c615..6b136fa49 100644 --- a/qcsrc/common/effects/all.qc +++ b/qcsrc/common/effects/all.qc @@ -30,7 +30,7 @@ void Read_Effect(bool is_new) if(eff_trail) WarpZone_TrailParticles(world, particleeffectnum(eff), v, vel); else - pointparticles(particleeffectnum(eff), v, vel, eff_cnt); + pointparticles(eff, v, vel, eff_cnt); } } #endif @@ -88,6 +88,6 @@ void Send_Effect_(string eff_name, vector eff_loc, vector eff_vel, int eff_cnt) return; )); // revert to engine handling - pointparticles(_particleeffectnum(eff_name), eff_loc, eff_vel, eff_cnt); + __pointparticles(_particleeffectnum(eff_name), eff_loc, eff_vel, eff_cnt); } #endif diff --git a/qcsrc/common/effects/effect.qh b/qcsrc/common/effects/effect.qh index bd9cd99e5..088136492 100644 --- a/qcsrc/common/effects/effect.qh +++ b/qcsrc/common/effects/effect.qh @@ -1,7 +1,21 @@ #ifndef EFFECT_H #define EFFECT_H -#define particleeffectnum(e) _particleeffectnum(e.eent_eff_name) +#define particleeffectnum(e) \ + _particleeffectnum(e.eent_eff_name) + +#if defined(SVQC) + #define pointparticles(effect, org, vel, howmany) \ + Send_Effect(effect, org, vel, howmany) + #define trailparticles(e, effect, org, vel) \ + ((!e) ? Send_Effect(effect, org, vel, 0) \ + : __trailparticles(e, particleeffectnum(effect), org, vel)) +#elif defined(CSQC) + #define pointparticles(effect, org, vel, howmany) \ + __pointparticles(particleeffectnum(effect), org, vel, howmany) + #define trailparticles(e, effect, org, vel) \ + __trailparticles(e, particleeffectnum(effect), org, vel) +#endif .int m_id; .string eent_eff_name; diff --git a/qcsrc/common/triggers/func/breakable.qc b/qcsrc/common/triggers/func/breakable.qc index 4164f8341..e03e23ea7 100644 --- a/qcsrc/common/triggers/func/breakable.qc +++ b/qcsrc/common/triggers/func/breakable.qc @@ -211,7 +211,7 @@ void func_breakable_destroy() RadiusDamage(self, activator, self.dmg, self.dmg_edge, self.dmg_radius, self, world, self.dmg_force, DEATH_HURTTRIGGER.m_id, world); if(self.cnt) // TODO - pointparticles(self.cnt, self.absmin * 0.5 + self.absmax * 0.5, '0 0 0', self.count); + __pointparticles(self.cnt, self.absmin * 0.5 + self.absmax * 0.5, '0 0 0', self.count); if(self.respawntime) { diff --git a/qcsrc/common/triggers/func/pointparticles.qc b/qcsrc/common/triggers/func/pointparticles.qc index a4f31b2fd..3b37f0f76 100644 --- a/qcsrc/common/triggers/func/pointparticles.qc +++ b/qcsrc/common/triggers/func/pointparticles.qc @@ -221,11 +221,11 @@ void Draw_PointParticles(entity this) { traceline(p, p + normalize(self.movedir) * 4096, 0, world); p = trace_endpos; - pointparticles(self.cnt, p, trace_plane_normal * vlen(self.movedir) + self.velocity + randomvec() * self.waterlevel, self.count); + __pointparticles(self.cnt, p, trace_plane_normal * vlen(self.movedir) + self.velocity + randomvec() * self.waterlevel, self.count); } else { - pointparticles(self.cnt, p, self.velocity + randomvec() * self.waterlevel, self.count); + __pointparticles(self.cnt, p, self.velocity + randomvec() * self.waterlevel, self.count); } if(self.noise != "") { diff --git a/qcsrc/common/triggers/misc/laser.qc b/qcsrc/common/triggers/misc/laser.qc index 06ca70543..e1c9cafb0 100644 --- a/qcsrc/common/triggers/misc/laser.qc +++ b/qcsrc/common/triggers/misc/laser.qc @@ -316,7 +316,7 @@ void Draw_Laser(entity this) if (!(trace_dphitq3surfaceflags & (Q3SURFACEFLAG_SKY | Q3SURFACEFLAG_NOIMPACT))) { if(self.cnt >= 0) - pointparticles(self.cnt, trace_endpos, trace_plane_normal, drawframetime * 1000); + __pointparticles(self.cnt, trace_endpos, trace_plane_normal, drawframetime * 1000); if(self.colormod != '0 0 0' && self.modelscale != 0) adddynamiclight(trace_endpos + trace_plane_normal * 1, self.modelscale, self.colormod * 5); } diff --git a/qcsrc/common/turrets/cl_turrets.qc b/qcsrc/common/turrets/cl_turrets.qc index 582113cf8..a38445b63 100644 --- a/qcsrc/common/turrets/cl_turrets.qc +++ b/qcsrc/common/turrets/cl_turrets.qc @@ -45,11 +45,11 @@ void turret_draw(entity this) if(self.health < 85) if(dt < 0.01) - pointparticles(particleeffectnum(EFFECT_SMOKE_LARGE), (self.origin + (randomvec() * 80)), '0 0 0', 1); + pointparticles(EFFECT_SMOKE_LARGE, (self.origin + (randomvec() * 80)), '0 0 0', 1); if(self.health < 32) if(dt < 0.015) - pointparticles(particleeffectnum(EFFECT_SMOKE_SMALL), (self.origin + (randomvec() * 80)), '0 0 0', 1); + pointparticles(EFFECT_SMOKE_SMALL, (self.origin + (randomvec() * 80)), '0 0 0', 1); } @@ -273,7 +273,7 @@ void turret_gibboom() float i; sound (self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM); - pointparticles(particleeffectnum(EFFECT_ROCKET_EXPLODE), self.origin, '0 0 0', 1); + pointparticles(EFFECT_ROCKET_EXPLODE, self.origin, '0 0 0', 1); for (i = 1; i < 5; i = i + 1) turret_gibtoss(strcat("models/turrets/head-gib", ftos(i), ".md3"), self.origin + '0 0 2', self.velocity + randomvec() * 700, '0 0 0', false); @@ -319,7 +319,7 @@ entity turret_gibtoss(string _model, vector _from, vector _to, vector _cmod, flo void turret_die() {SELFPARAM(); sound (self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM); - pointparticles(particleeffectnum(EFFECT_ROCKET_EXPLODE), self.origin, '0 0 0', 1); + pointparticles(EFFECT_ROCKET_EXPLODE, self.origin, '0 0 0', 1); if (!autocvar_cl_nogibs) { // Base diff --git a/qcsrc/common/vehicles/sv_vehicles.qc b/qcsrc/common/vehicles/sv_vehicles.qc index a00cdcfa3..1a315f4f4 100644 --- a/qcsrc/common/vehicles/sv_vehicles.qc +++ b/qcsrc/common/vehicles/sv_vehicles.qc @@ -634,7 +634,7 @@ void vehicles_painframe() float _ftmp; _ftmp = self.owner.vehicle_health / 50; self.pain_frame = time + 0.1 + (random() * 0.5 * _ftmp); - pointparticles(particleeffectnum(EFFECT_SMOKE_SMALL), (self.origin + (randomvec() * 80)), '0 0 0', 1); + pointparticles(EFFECT_SMOKE_SMALL, (self.origin + (randomvec() * 80)), '0 0 0', 1); if(self.vehicle_flags & VHF_DMGSHAKE) self.velocity += randomvec() * 30; diff --git a/qcsrc/common/vehicles/vehicle/racer.qc b/qcsrc/common/vehicles/vehicle/racer.qc index 6844efa08..1f573cda3 100644 --- a/qcsrc/common/vehicles/vehicle/racer.qc +++ b/qcsrc/common/vehicles/vehicle/racer.qc @@ -257,7 +257,7 @@ float racer_frame() { #ifdef SVQC if(time - racer.wait > 0.2) - pointparticles(particleeffectnum(EFFECT_RACER_BOOSTER), self.origin - v_forward * 32, v_forward * vlen(self.velocity), 1); + pointparticles(EFFECT_RACER_BOOSTER, self.origin - v_forward * 32, v_forward * vlen(self.velocity), 1); #endif racer.wait = time; @@ -278,7 +278,7 @@ float racer_frame() { traceline(racer.origin, racer.origin - '0 0 256', MOVE_NORMAL, self); if(trace_fraction != 1.0) - pointparticles(particleeffectnum(EFFECT_SMOKE_SMALL), trace_endpos, '0 0 0', 1); + pointparticles(EFFECT_SMOKE_SMALL, trace_endpos, '0 0 0', 1); racer.invincible_finished = time + 0.1 + (random() * 0.1); } diff --git a/qcsrc/common/vehicles/vehicle/spiderbot.qc b/qcsrc/common/vehicles/vehicle/spiderbot.qc index ec479fe9f..8cb248781 100644 --- a/qcsrc/common/vehicles/vehicle/spiderbot.qc +++ b/qcsrc/common/vehicles/vehicle/spiderbot.qc @@ -295,7 +295,7 @@ float spiderbot_frame() sound (gun, CH_WEAPON_A, SND_UZI_FIRE, VOL_BASE, ATTEN_NORM); //trailparticles(self, _particleeffectnum("spiderbot_minigun_trail"), v, trace_endpos); - pointparticles(particleeffectnum(EFFECT_SPIDERBOT_MINIGUN_MUZZLEFLASH), v, v_forward * 2500, 1); + pointparticles(EFFECT_SPIDERBOT_MINIGUN_MUZZLEFLASH, v, v_forward * 2500, 1); setself(spider); diff --git a/qcsrc/common/weapons/weapon/arc.qc b/qcsrc/common/weapons/weapon/arc.qc index 37895b478..07ddea833 100644 --- a/qcsrc/common/weapons/weapon/arc.qc +++ b/qcsrc/common/weapons/weapon/arc.qc @@ -101,10 +101,10 @@ void Ent_ReadArcBeam(float isnew); .vector beam_color; .float beam_alpha; .float beam_thickness; -.float beam_traileffect; -.float beam_hiteffect; +.entity beam_traileffect; +.entity beam_hiteffect; .float beam_hitlight[4]; // 0: radius, 123: rgb -.float beam_muzzleeffect; +.entity beam_muzzleeffect; .float beam_muzzlelight[4]; // 0: radius, 123: rgb .string beam_image; @@ -1258,18 +1258,18 @@ void Ent_ReadArcBeam(float isnew) self.beam_color = '1 1 1'; self.beam_alpha = 0.5; self.beam_thickness = 8; - self.beam_traileffect = particleeffectnum(EFFECT_ARC_BEAM); - self.beam_hiteffect = particleeffectnum(EFFECT_ARC_LIGHTNING); + self.beam_traileffect = (EFFECT_ARC_BEAM); + self.beam_hiteffect = (EFFECT_ARC_LIGHTNING); self.beam_hitlight[0] = 0; self.beam_hitlight[1] = 1; self.beam_hitlight[2] = 1; self.beam_hitlight[3] = 1; - self.beam_muzzleeffect = -1; //particleeffectnum(EFFECT_VORTEX_MUZZLEFLASH); + self.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH); self.beam_muzzlelight[0] = 0; self.beam_muzzlelight[1] = 1; self.beam_muzzlelight[2] = 1; self.beam_muzzlelight[3] = 1; - if(self.beam_muzzleeffect >= 0) + if(self.beam_muzzleeffect) { setmodel(flash, MDL_ARC_MUZZLEFLASH); flash.alpha = self.beam_alpha; @@ -1283,19 +1283,19 @@ void Ent_ReadArcBeam(float isnew) self.beam_color = '1 1 1'; self.beam_alpha = 0.5; self.beam_thickness = 8; - self.beam_traileffect = particleeffectnum(EFFECT_ARC_BEAM); - self.beam_hiteffect = particleeffectnum(EFFECT_ARC_LIGHTNING); + self.beam_traileffect = (EFFECT_ARC_BEAM); + self.beam_hiteffect = (EFFECT_ARC_LIGHTNING); self.beam_hitlight[0] = 0; self.beam_hitlight[1] = 1; self.beam_hitlight[2] = 1; self.beam_hitlight[3] = 1; - self.beam_muzzleeffect = -1; // particleeffectnum(EFFECT_GRENADE_MUZZLEFLASH); + self.beam_muzzleeffect = NULL; // (EFFECT_GRENADE_MUZZLEFLASH); self.beam_muzzlelight[0] = 0; self.beam_muzzlelight[1] = 1; self.beam_muzzlelight[2] = 1; self.beam_muzzlelight[3] = 1; self.beam_image = "particles/lgbeam"; - if(self.beam_muzzleeffect >= 0) + if(self.beam_muzzleeffect) { setmodel(flash, MDL_ARC_MUZZLEFLASH); flash.alpha = self.beam_alpha; @@ -1309,19 +1309,19 @@ void Ent_ReadArcBeam(float isnew) self.beam_color = '1 1 1'; self.beam_alpha = 0.5; self.beam_thickness = 8; - self.beam_traileffect = particleeffectnum(EFFECT_ARC_BEAM_HEAL); - self.beam_hiteffect = particleeffectnum(EFFECT_ARC_BEAM_HEAL_IMPACT); + self.beam_traileffect = (EFFECT_ARC_BEAM_HEAL); + self.beam_hiteffect = (EFFECT_ARC_BEAM_HEAL_IMPACT); self.beam_hitlight[0] = 0; self.beam_hitlight[1] = 1; self.beam_hitlight[2] = 1; self.beam_hitlight[3] = 1; - self.beam_muzzleeffect = -1; //particleeffectnum(EFFECT_VORTEX_MUZZLEFLASH); + self.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH); self.beam_muzzlelight[0] = 0; self.beam_muzzlelight[1] = 1; self.beam_muzzlelight[2] = 1; self.beam_muzzlelight[3] = 1; self.beam_image = "particles/lgbeam"; - if(self.beam_muzzleeffect >= 0) + if(self.beam_muzzleeffect) { setmodel(flash, MDL_ARC_MUZZLEFLASH); flash.alpha = self.beam_alpha; @@ -1335,19 +1335,19 @@ void Ent_ReadArcBeam(float isnew) self.beam_color = '1 1 1'; self.beam_alpha = 0.5; self.beam_thickness = 8; - self.beam_traileffect = particleeffectnum(EFFECT_ARC_BEAM); - self.beam_hiteffect = particleeffectnum(EFFECT_ARC_LIGHTNING); + self.beam_traileffect = (EFFECT_ARC_BEAM); + self.beam_hiteffect = (EFFECT_ARC_LIGHTNING); self.beam_hitlight[0] = 20; self.beam_hitlight[1] = 1; self.beam_hitlight[2] = 0; self.beam_hitlight[3] = 0; - self.beam_muzzleeffect = -1; //particleeffectnum(EFFECT_VORTEX_MUZZLEFLASH); + self.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH); self.beam_muzzlelight[0] = 50; self.beam_muzzlelight[1] = 1; self.beam_muzzlelight[2] = 0; self.beam_muzzlelight[3] = 0; self.beam_image = "particles/lgbeam"; - if(self.beam_muzzleeffect >= 0) + if(self.beam_muzzleeffect) { setmodel(flash, MDL_ARC_MUZZLEFLASH); flash.alpha = self.beam_alpha; @@ -1361,19 +1361,19 @@ void Ent_ReadArcBeam(float isnew) self.beam_color = '1 1 1'; self.beam_alpha = 0.5; self.beam_thickness = 14; - self.beam_traileffect = particleeffectnum(EFFECT_ARC_BEAM); - self.beam_hiteffect = particleeffectnum(EFFECT_ARC_LIGHTNING); + self.beam_traileffect = (EFFECT_ARC_BEAM); + self.beam_hiteffect = (EFFECT_ARC_LIGHTNING); self.beam_hitlight[0] = 0; self.beam_hitlight[1] = 1; self.beam_hitlight[2] = 1; self.beam_hitlight[3] = 1; - self.beam_muzzleeffect = -1; //particleeffectnum(EFFECT_VORTEX_MUZZLEFLASH); + self.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH); self.beam_muzzlelight[0] = 0; self.beam_muzzlelight[1] = 1; self.beam_muzzlelight[2] = 1; self.beam_muzzlelight[3] = 1; self.beam_image = "particles/lgbeam"; - if(self.beam_muzzleeffect >= 0) + if(self.beam_muzzleeffect) { setmodel(flash, MDL_ARC_MUZZLEFLASH); flash.alpha = self.beam_alpha; @@ -1387,19 +1387,19 @@ void Ent_ReadArcBeam(float isnew) self.beam_color = '1 1 1'; self.beam_alpha = 0.5; self.beam_thickness = 14; - self.beam_traileffect = particleeffectnum(EFFECT_ARC_BEAM); - self.beam_hiteffect = particleeffectnum(EFFECT_ARC_LIGHTNING); + self.beam_traileffect = (EFFECT_ARC_BEAM); + self.beam_hiteffect = (EFFECT_ARC_LIGHTNING); self.beam_hitlight[0] = 0; self.beam_hitlight[1] = 1; self.beam_hitlight[2] = 1; self.beam_hitlight[3] = 1; - self.beam_muzzleeffect = -1; //particleeffectnum(EFFECT_VORTEX_MUZZLEFLASH); + self.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH); self.beam_muzzlelight[0] = 0; self.beam_muzzlelight[1] = 1; self.beam_muzzlelight[2] = 1; self.beam_muzzlelight[3] = 1; self.beam_image = "particles/lgbeam"; - if(self.beam_muzzleeffect >= 0) + if(self.beam_muzzleeffect) { setmodel(flash, MDL_ARC_MUZZLEFLASH); flash.alpha = self.beam_alpha; @@ -1413,19 +1413,19 @@ void Ent_ReadArcBeam(float isnew) self.beam_color = '1 1 1'; self.beam_alpha = 0.5; self.beam_thickness = 14; - self.beam_traileffect = particleeffectnum(EFFECT_ARC_BEAM_HEAL); - self.beam_hiteffect = particleeffectnum(EFFECT_ARC_BEAM_HEAL_IMPACT2); + self.beam_traileffect = (EFFECT_ARC_BEAM_HEAL); + self.beam_hiteffect = (EFFECT_ARC_BEAM_HEAL_IMPACT2); self.beam_hitlight[0] = 0; self.beam_hitlight[1] = 1; self.beam_hitlight[2] = 1; self.beam_hitlight[3] = 1; - self.beam_muzzleeffect = -1; //particleeffectnum(EFFECT_VORTEX_MUZZLEFLASH); + self.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH); self.beam_muzzlelight[0] = 0; self.beam_muzzlelight[1] = 1; self.beam_muzzlelight[2] = 1; self.beam_muzzlelight[3] = 1; self.beam_image = "particles/lgbeam"; - if(self.beam_muzzleeffect >= 0) + if(self.beam_muzzleeffect) { setmodel(flash, MDL_ARC_MUZZLEFLASH); flash.alpha = self.beam_alpha; @@ -1439,19 +1439,19 @@ void Ent_ReadArcBeam(float isnew) self.beam_color = '1 1 1'; self.beam_alpha = 0.5; self.beam_thickness = 14; - self.beam_traileffect = particleeffectnum(EFFECT_ARC_BEAM); - self.beam_hiteffect = particleeffectnum(EFFECT_ARC_LIGHTNING); + self.beam_traileffect = (EFFECT_ARC_BEAM); + self.beam_hiteffect = (EFFECT_ARC_LIGHTNING); self.beam_hitlight[0] = 0; self.beam_hitlight[1] = 1; self.beam_hitlight[2] = 1; self.beam_hitlight[3] = 1; - self.beam_muzzleeffect = -1; //particleeffectnum(EFFECT_VORTEX_MUZZLEFLASH); + self.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH); self.beam_muzzlelight[0] = 0; self.beam_muzzlelight[1] = 1; self.beam_muzzlelight[2] = 1; self.beam_muzzlelight[3] = 1; self.beam_image = "particles/lgbeam"; - if(self.beam_muzzleeffect >= 0) + if(self.beam_muzzleeffect) { setmodel(flash, MDL_ARC_MUZZLEFLASH); flash.alpha = self.beam_alpha; @@ -1467,19 +1467,19 @@ void Ent_ReadArcBeam(float isnew) self.beam_color = randomvec(); self.beam_alpha = 1; self.beam_thickness = 8; - self.beam_traileffect = false; - self.beam_hiteffect = false; + self.beam_traileffect = NULL; + self.beam_hiteffect = NULL; self.beam_hitlight[0] = 0; self.beam_hitlight[1] = 1; self.beam_hitlight[2] = 1; self.beam_hitlight[3] = 1; - self.beam_muzzleeffect = -1; //particleeffectnum(EFFECT_VORTEX_MUZZLEFLASH); + self.beam_muzzleeffect = NULL; //(EFFECT_VORTEX_MUZZLEFLASH); self.beam_muzzlelight[0] = 0; self.beam_muzzlelight[1] = 1; self.beam_muzzlelight[2] = 1; self.beam_muzzlelight[3] = 1; self.beam_image = "particles/lgbeam"; - if(self.beam_muzzleeffect >= 0) + if(self.beam_muzzleeffect) { setmodel(flash, MDL_ARC_MUZZLEFLASH); flash.alpha = self.beam_alpha; diff --git a/qcsrc/common/weapons/weapon/blaster.qc b/qcsrc/common/weapons/weapon/blaster.qc index 4ada2d5b7..8c483b346 100644 --- a/qcsrc/common/weapons/weapon/blaster.qc +++ b/qcsrc/common/weapons/weapon/blaster.qc @@ -262,7 +262,7 @@ void W_Blaster_Attack( { vector org2; org2 = w_org + w_backoff * 6; - pointparticles(particleeffectnum(EFFECT_BLASTER_IMPACT), org2, w_backoff * 1000, 1); + pointparticles(EFFECT_BLASTER_IMPACT, org2, w_backoff * 1000, 1); if(!w_issilent) { sound(self, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTN_NORM); } } diff --git a/qcsrc/common/weapons/weapon/crylink.qc b/qcsrc/common/weapons/weapon/crylink.qc index 21565113d..11e6924d8 100644 --- a/qcsrc/common/weapons/weapon/crylink.qc +++ b/qcsrc/common/weapons/weapon/crylink.qc @@ -683,13 +683,13 @@ void W_Crylink_Attack2(Weapon thiswep) org2 = w_org + w_backoff * 2; if(w_deathtype & HITTYPE_SECONDARY) { - pointparticles(particleeffectnum(EFFECT_CRYLINK_IMPACT2), org2, '0 0 0', 1); + pointparticles(EFFECT_CRYLINK_IMPACT2, org2, '0 0 0', 1); if(!w_issilent) sound(self, CH_SHOTS, SND_CRYLINK_IMPACT2, VOL_BASE, ATTN_NORM); } else { - pointparticles(particleeffectnum(EFFECT_CRYLINK_IMPACT), org2, '0 0 0', 1); + pointparticles(EFFECT_CRYLINK_IMPACT, org2, '0 0 0', 1); if(!w_issilent) sound(self, CH_SHOTS, SND_CRYLINK_IMPACT, VOL_BASE, ATTN_NORM); } diff --git a/qcsrc/common/weapons/weapon/devastator.qc b/qcsrc/common/weapons/weapon/devastator.qc index 63789a92a..dbd8f651a 100644 --- a/qcsrc/common/weapons/weapon/devastator.qc +++ b/qcsrc/common/weapons/weapon/devastator.qc @@ -639,7 +639,7 @@ void W_Devastator_Attack(Weapon thiswep) { vector org2; org2 = w_org + w_backoff * 12; - pointparticles(particleeffectnum(EFFECT_ROCKET_EXPLODE), org2, '0 0 0', 1); + pointparticles(EFFECT_ROCKET_EXPLODE, org2, '0 0 0', 1); if(!w_issilent) sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTN_NORM); } diff --git a/qcsrc/common/weapons/weapon/electro.qc b/qcsrc/common/weapons/weapon/electro.qc index bf183b35e..8ae3f3e3c 100644 --- a/qcsrc/common/weapons/weapon/electro.qc +++ b/qcsrc/common/weapons/weapon/electro.qc @@ -557,7 +557,7 @@ void W_Electro_CheckAttack(Weapon thiswep, entity actor, int slot, int fire) org2 = w_org + w_backoff * 6; if(w_deathtype & HITTYPE_SECONDARY) { - pointparticles(particleeffectnum(EFFECT_ELECTRO_BALLEXPLODE), org2, '0 0 0', 1); + pointparticles(EFFECT_ELECTRO_BALLEXPLODE, org2, '0 0 0', 1); if(!w_issilent) sound(self, CH_SHOTS, SND_ELECTRO_IMPACT, VOL_BASE, ATTEN_NORM); } @@ -566,13 +566,13 @@ void W_Electro_CheckAttack(Weapon thiswep, entity actor, int slot, int fire) if(w_deathtype & HITTYPE_BOUNCE) { // this is sent as "primary (w_deathtype & HITTYPE_BOUNCE)" to distinguish it from (w_deathtype & HITTYPE_SECONDARY) bounced balls - pointparticles(particleeffectnum(EFFECT_ELECTRO_COMBO), org2, '0 0 0', 1); + pointparticles(EFFECT_ELECTRO_COMBO, org2, '0 0 0', 1); if(!w_issilent) sound(self, CH_SHOTS, SND_ELECTRO_IMPACT_COMBO, VOL_BASE, ATTEN_NORM); } else { - pointparticles(particleeffectnum(EFFECT_ELECTRO_IMPACT), org2, '0 0 0', 1); + pointparticles(EFFECT_ELECTRO_IMPACT, org2, '0 0 0', 1); if(!w_issilent) sound(self, CH_SHOTS, SND_ELECTRO_IMPACT, VOL_BASE, ATTEN_NORM); } diff --git a/qcsrc/common/weapons/weapon/fireball.qc b/qcsrc/common/weapons/weapon/fireball.qc index 3a236a36e..a2ff0de59 100644 --- a/qcsrc/common/weapons/weapon/fireball.qc +++ b/qcsrc/common/weapons/weapon/fireball.qc @@ -443,7 +443,7 @@ void W_Fireball_Attack2(void) else { org2 = w_org + w_backoff * 16; - pointparticles(particleeffectnum(EFFECT_FIREBALL_EXPLODE), org2, '0 0 0', 1); + pointparticles(EFFECT_FIREBALL_EXPLODE, org2, '0 0 0', 1); if(!w_issilent) sound(self, CH_SHOTS, SND_FIREBALL_IMPACT2, VOL_BASE, ATTEN_NORM * 0.25); // long range boom } diff --git a/qcsrc/common/weapons/weapon/hagar.qc b/qcsrc/common/weapons/weapon/hagar.qc index a7c1ecd9e..e7621c241 100644 --- a/qcsrc/common/weapons/weapon/hagar.qc +++ b/qcsrc/common/weapons/weapon/hagar.qc @@ -509,7 +509,7 @@ void W_Hagar_Attack2_Load(Weapon thiswep, int slot) { vector org2; org2 = w_org + w_backoff * 6; - pointparticles(particleeffectnum(EFFECT_HAGAR_EXPLODE), org2, '0 0 0', 1); + pointparticles(EFFECT_HAGAR_EXPLODE, org2, '0 0 0', 1); if(!w_issilent) { if(w_random<0.15) diff --git a/qcsrc/common/weapons/weapon/hlac.qc b/qcsrc/common/weapons/weapon/hlac.qc index 2c9ed7f8d..5a91976ff 100644 --- a/qcsrc/common/weapons/weapon/hlac.qc +++ b/qcsrc/common/weapons/weapon/hlac.qc @@ -275,7 +275,7 @@ void W_HLAC_Attack2_Frame(Weapon thiswep) { vector org2; org2 = w_org + w_backoff * 6; - pointparticles(particleeffectnum(EFFECT_BLASTER_IMPACT), org2, w_backoff * 1000, 1); + pointparticles(EFFECT_BLASTER_IMPACT, org2, w_backoff * 1000, 1); if(!w_issilent) sound(self, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTN_NORM); } diff --git a/qcsrc/common/weapons/weapon/hmg.qc b/qcsrc/common/weapons/weapon/hmg.qc index 9ebc56f67..c7ae7d43b 100644 --- a/qcsrc/common/weapons/weapon/hmg.qc +++ b/qcsrc/common/weapons/weapon/hmg.qc @@ -160,7 +160,7 @@ void W_HeavyMachineGun_Attack_Auto(Weapon thiswep, entity actor, int slot, int f { vector org2; org2 = w_org + w_backoff * 2; - pointparticles(particleeffectnum(EFFECT_MACHINEGUN_IMPACT), org2, w_backoff * 1000, 1); + pointparticles(EFFECT_MACHINEGUN_IMPACT, org2, w_backoff * 1000, 1); if(!w_issilent) if(w_random < 0.05) sound(self, CH_SHOTS, SND_RIC1, VOL_BASE, ATTEN_NORM); diff --git a/qcsrc/common/weapons/weapon/hook.qc b/qcsrc/common/weapons/weapon/hook.qc index 75ed07b17..315310b36 100644 --- a/qcsrc/common/weapons/weapon/hook.qc +++ b/qcsrc/common/weapons/weapon/hook.qc @@ -313,7 +313,7 @@ void W_Hook_Attack2(Weapon thiswep, entity actor) { vector org2; org2 = w_org + w_backoff * 2; - pointparticles(particleeffectnum(EFFECT_HOOK_EXPLODE), org2, '0 0 0', 1); + pointparticles(EFFECT_HOOK_EXPLODE, org2, '0 0 0', 1); if(!w_issilent) sound(self, CH_SHOTS, SND_HOOKBOMB_IMPACT, VOL_BASE, ATTN_NORM); } diff --git a/qcsrc/common/weapons/weapon/machinegun.qc b/qcsrc/common/weapons/weapon/machinegun.qc index 85fc1aeb1..f27e0916d 100644 --- a/qcsrc/common/weapons/weapon/machinegun.qc +++ b/qcsrc/common/weapons/weapon/machinegun.qc @@ -365,7 +365,7 @@ void W_MachineGun_Attack_Burst(Weapon thiswep, entity actor, int slot, int fire) { vector org2; org2 = w_org + w_backoff * 2; - pointparticles(particleeffectnum(EFFECT_MACHINEGUN_IMPACT), org2, w_backoff * 1000, 1); + pointparticles(EFFECT_MACHINEGUN_IMPACT, org2, w_backoff * 1000, 1); if(!w_issilent) if(w_random < 0.05) sound(self, CH_SHOTS, SND_RIC1, VOL_BASE, ATTN_NORM); diff --git a/qcsrc/common/weapons/weapon/minelayer.qc b/qcsrc/common/weapons/weapon/minelayer.qc index ba255fbe2..938f20390 100644 --- a/qcsrc/common/weapons/weapon/minelayer.qc +++ b/qcsrc/common/weapons/weapon/minelayer.qc @@ -577,7 +577,7 @@ float W_MineLayer_PlacedMines(float detonate) { vector org2; org2 = w_org + w_backoff * 12; - pointparticles(particleeffectnum(EFFECT_ROCKET_EXPLODE), org2, '0 0 0', 1); + pointparticles(EFFECT_ROCKET_EXPLODE, org2, '0 0 0', 1); if(!w_issilent) sound(self, CH_SHOTS, SND_MINE_EXP, VOL_BASE, ATTN_NORM); } diff --git a/qcsrc/common/weapons/weapon/mortar.qc b/qcsrc/common/weapons/weapon/mortar.qc index 951fa7078..f2e2013d8 100644 --- a/qcsrc/common/weapons/weapon/mortar.qc +++ b/qcsrc/common/weapons/weapon/mortar.qc @@ -417,7 +417,7 @@ void W_Mortar_Attack2(Weapon thiswep) { vector org2; org2 = w_org + w_backoff * 12; - pointparticles(particleeffectnum(EFFECT_GRENADE_EXPLODE), org2, '0 0 0', 1); + pointparticles(EFFECT_GRENADE_EXPLODE, org2, '0 0 0', 1); if(!w_issilent) sound(self, CH_SHOTS, SND_GRENADE_IMPACT, VOL_BASE, ATTN_NORM); } diff --git a/qcsrc/common/weapons/weapon/rifle.qc b/qcsrc/common/weapons/weapon/rifle.qc index cbe6d39fa..63d77d80f 100644 --- a/qcsrc/common/weapons/weapon/rifle.qc +++ b/qcsrc/common/weapons/weapon/rifle.qc @@ -254,7 +254,7 @@ void W_Rifle_BulletHail(int slot, float mode, void(void) AttackFunc, float fr, f { vector org2; org2 = w_org + w_backoff * 2; - pointparticles(particleeffectnum(EFFECT_RIFLE_IMPACT), org2, w_backoff * 1000, 1); + pointparticles(EFFECT_RIFLE_IMPACT, org2, w_backoff * 1000, 1); if(!w_issilent) { if(w_random < 0.2) diff --git a/qcsrc/common/weapons/weapon/rpc.qc b/qcsrc/common/weapons/weapon/rpc.qc index 73794ca03..f25bef42f 100644 --- a/qcsrc/common/weapons/weapon/rpc.qc +++ b/qcsrc/common/weapons/weapon/rpc.qc @@ -222,7 +222,7 @@ void W_RocketPropelledChainsaw_Attack (Weapon thiswep) { vector org2; org2 = w_org + w_backoff * 12; - pointparticles(particleeffectnum(EFFECT_ROCKET_EXPLODE), org2, '0 0 0', 1); + pointparticles(EFFECT_ROCKET_EXPLODE, org2, '0 0 0', 1); if(!w_issilent) sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM); } diff --git a/qcsrc/common/weapons/weapon/seeker.qc b/qcsrc/common/weapons/weapon/seeker.qc index 32deee0d3..8fd7aa896 100644 --- a/qcsrc/common/weapons/weapon/seeker.qc +++ b/qcsrc/common/weapons/weapon/seeker.qc @@ -723,7 +723,7 @@ void W_Seeker_Fire_Tag(Weapon thiswep) } else { - pointparticles(particleeffectnum(EFFECT_HAGAR_EXPLODE), org2, '0 0 0', 1); + pointparticles(EFFECT_HAGAR_EXPLODE, org2, '0 0 0', 1); if(!w_issilent) { if(w_random<0.15) @@ -737,7 +737,7 @@ void W_Seeker_Fire_Tag(Weapon thiswep) } else { - pointparticles(particleeffectnum(EFFECT_HAGAR_EXPLODE), org2, '0 0 0', 1); + pointparticles(EFFECT_HAGAR_EXPLODE, org2, '0 0 0', 1); if(!w_issilent) { if(w_random<0.15) diff --git a/qcsrc/common/weapons/weapon/shockwave.qc b/qcsrc/common/weapons/weapon/shockwave.qc index 3c40adc31..a16c2d68b 100644 --- a/qcsrc/common/weapons/weapon/shockwave.qc +++ b/qcsrc/common/weapons/weapon/shockwave.qc @@ -856,7 +856,7 @@ void Net_ReadShockwaveParticle(void) // handled by Net_ReadShockwaveParticle //vector org2; //org2 = w_org + w_backoff * 2; - //pointparticles(particleeffectnum(EFFECT_BLASTER_IMPACT), org2, w_backoff * 1000, 1); + //pointparticles(EFFECT_BLASTER_IMPACT, org2, w_backoff * 1000, 1); } #endif diff --git a/qcsrc/common/weapons/weapon/shotgun.qc b/qcsrc/common/weapons/weapon/shotgun.qc index 5e4523cdf..da08705ee 100644 --- a/qcsrc/common/weapons/weapon/shotgun.qc +++ b/qcsrc/common/weapons/weapon/shotgun.qc @@ -339,7 +339,7 @@ void W_Shotgun_Attack3_Frame1(Weapon thiswep, entity actor, int slot, int fire) METHOD(Shotgun, wr_impacteffect, void(entity thiswep)) { vector org2 = w_org + w_backoff * 2; - pointparticles(particleeffectnum(EFFECT_SHOTGUN_IMPACT), org2, w_backoff * 1000, 1); + pointparticles(EFFECT_SHOTGUN_IMPACT, org2, w_backoff * 1000, 1); if(!w_issilent && time - self.prevric > 0.25) { if(w_random < 0.0165) diff --git a/qcsrc/common/weapons/weapon/vaporizer.qc b/qcsrc/common/weapons/weapon/vaporizer.qc index f8aceb107..6830c9001 100644 --- a/qcsrc/common/weapons/weapon/vaporizer.qc +++ b/qcsrc/common/weapons/weapon/vaporizer.qc @@ -381,12 +381,12 @@ void W_RocketMinsta_Attack3 (void) vector org2 = w_org + w_backoff * 6; if(w_deathtype & HITTYPE_SECONDARY) { - pointparticles(particleeffectnum(EFFECT_BLASTER_IMPACT), org2, w_backoff * 1000, 1); + pointparticles(EFFECT_BLASTER_IMPACT, org2, w_backoff * 1000, 1); if(!w_issilent) { sound(self, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTN_NORM); } } else { - pointparticles(particleeffectnum(EFFECT_VORTEX_IMPACT), org2, '0 0 0', 1); + pointparticles(EFFECT_VORTEX_IMPACT, org2, '0 0 0', 1); if(!w_issilent) { sound(self, CH_SHOTS, SND_NEXIMPACT, VOL_BASE, ATTN_NORM); } } } diff --git a/qcsrc/common/weapons/weapon/vortex.qc b/qcsrc/common/weapons/weapon/vortex.qc index 584b1a511..790d5c2b8 100644 --- a/qcsrc/common/weapons/weapon/vortex.qc +++ b/qcsrc/common/weapons/weapon/vortex.qc @@ -306,7 +306,7 @@ float autocvar_g_balance_vortex_secondary = 0; // WEAPONTODO METHOD(Vortex, wr_impacteffect, void(entity thiswep)) { vector org2 = w_org + w_backoff * 6; - pointparticles(particleeffectnum(EFFECT_VORTEX_IMPACT), org2, '0 0 0', 1); + pointparticles(EFFECT_VORTEX_IMPACT, org2, '0 0 0', 1); if(!w_issilent) sound(self, CH_SHOTS, SND_NEXIMPACT, VOL_BASE, ATTN_NORM); } diff --git a/qcsrc/dpdefs/csprogsdefs.qh b/qcsrc/dpdefs/csprogsdefs.qh index 6ad27242a..6f9c9d637 100644 --- a/qcsrc/dpdefs/csprogsdefs.qh +++ b/qcsrc/dpdefs/csprogsdefs.qh @@ -10,6 +10,8 @@ #define spawn _spawn #define particleeffectnum _particleeffectnum +#define trailparticles __trailparticles +#define pointparticles __pointparticles #define setmodel _setmodel #include "upstream/csprogsdefs.qc" @@ -21,6 +23,8 @@ #undef spawn #undef particleeffectnum +#undef trailparticles +#undef pointparticles #undef setmodel #pragma noref 0 diff --git a/qcsrc/dpdefs/dpextensions.qh b/qcsrc/dpdefs/dpextensions.qh index 7b437082f..ff9214844 100644 --- a/qcsrc/dpdefs/dpextensions.qh +++ b/qcsrc/dpdefs/dpextensions.qh @@ -4,10 +4,14 @@ #pragma noref 1 #define particleeffectnum __particleeffectnum +#define trailparticles __trailparticles +#define pointparticles __pointparticles #include "upstream/dpextensions.qc" #undef particleeffectnum +#undef trailparticles +#undef pointparticles int(entity ent, string tagname) _gettagindex = #451; #define gettagindex _gettagindex diff --git a/qcsrc/lib/warpzone/common.qc b/qcsrc/lib/warpzone/common.qc index 6fe901bd8..a04ee59e4 100644 --- a/qcsrc/lib/warpzone/common.qc +++ b/qcsrc/lib/warpzone/common.qc @@ -457,7 +457,7 @@ entity WarpZone_TrailParticles_trace_callback_own; float WarpZone_TrailParticles_trace_callback_eff; void WarpZone_TrailParticles_trace_callback(vector from, vector endpos, vector to) { - trailparticles(WarpZone_TrailParticles_trace_callback_own, WarpZone_TrailParticles_trace_callback_eff, from, endpos); + __trailparticles(WarpZone_TrailParticles_trace_callback_own, WarpZone_TrailParticles_trace_callback_eff, from, endpos); } void WarpZone_TrailParticles(entity own, float eff, vector org, vector end) diff --git a/qcsrc/server/cheats.qc b/qcsrc/server/cheats.qc index 4b6405581..dc6d63b0c 100644 --- a/qcsrc/server/cheats.qc +++ b/qcsrc/server/cheats.qc @@ -338,7 +338,7 @@ float CheatCommand(float argc) effectnum = _particleeffectnum(argv(1)); W_SetupShot(self, false, false, "", CH_WEAPON_A, 0); traceline(w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, MOVE_NORMAL, self); - trailparticles(self, effectnum, w_shotorg, trace_endpos); + __trailparticles(self, effectnum, w_shotorg, trace_endpos); DID_CHEAT(); break; } diff --git a/qcsrc/server/command/sv_cmd.qc b/qcsrc/server/command/sv_cmd.qc index c65bd8fa9..4b972f0de 100644 --- a/qcsrc/server/command/sv_cmd.qc +++ b/qcsrc/server/command/sv_cmd.qc @@ -1665,8 +1665,8 @@ void GameCommand_trace(float request, float argc) vv = stov(argv(2)); dv = stov(argv(3)); traceline(vv, dv, MOVE_NORMAL, world); - trailparticles(world, particleeffectnum(EFFECT_TR_NEXUIZPLASMA), vv, trace_endpos); - trailparticles(world, particleeffectnum(EFFECT_TR_CRYLINKPLASMA), trace_endpos, dv); + __trailparticles(world, particleeffectnum(EFFECT_TR_NEXUIZPLASMA), vv, trace_endpos); + __trailparticles(world, particleeffectnum(EFFECT_TR_CRYLINKPLASMA), trace_endpos, dv); return; } } diff --git a/qcsrc/server/mutators/mutator/gamemode_onslaught.qc b/qcsrc/server/mutators/mutator/gamemode_onslaught.qc index 5d23ec73b..78e643018 100644 --- a/qcsrc/server/mutators/mutator/gamemode_onslaught.qc +++ b/qcsrc/server/mutators/mutator/gamemode_onslaught.qc @@ -530,7 +530,7 @@ void ons_ControlPoint_Icon_Damage(entity inflictor, entity attacker, float damag WaypointSprite_UpdateBuildFinished(self.owner.sprite, time + (self.max_health - self.health) / (self.count / ONS_CP_THINKRATE)); self.pain_finished = time + 1; // particles on every hit - pointparticles(particleeffectnum(EFFECT_SPARKS), hitloc, force*-1, 1); + pointparticles(EFFECT_SPARKS, hitloc, force*-1, 1); //sound on every hit if (random() < 0.5) sound(self, CH_TRIGGER, SND_ONS_HIT1, VOL_BASE+0.3, ATTEN_NORM); @@ -540,7 +540,7 @@ void ons_ControlPoint_Icon_Damage(entity inflictor, entity attacker, float damag if (self.health < 0) { sound(self, CH_TRIGGER, SND_GRENADE_IMPACT, VOL_BASE, ATTEN_NORM); - pointparticles(particleeffectnum(EFFECT_ROCKET_EXPLODE), self.origin, '0 0 0', 1); + pointparticles(EFFECT_ROCKET_EXPLODE, self.origin, '0 0 0', 1); Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM_4(self.team, INFO_ONSLAUGHT_CPDESTROYED_), self.owner.message, attacker.netname); PlayerScore_Add(attacker, SP_ONS_TAKES, 1); diff --git a/qcsrc/server/weapons/tracing.qc b/qcsrc/server/weapons/tracing.qc index 6b7054f95..3f57a3bb3 100644 --- a/qcsrc/server/weapons/tracing.qc +++ b/qcsrc/server/weapons/tracing.qc @@ -358,11 +358,11 @@ void fireBullet(vector start, vector dir, float spread, float max_solid_penetrat float total_damage = 0; if(tracereffects & EF_RED) - fireBullet_trace_callback_eff = particleeffectnum(EFFECT_RIFLE); + fireBullet_trace_callback_eff = EFFECT_RIFLE; else if(tracereffects & EF_BLUE) - fireBullet_trace_callback_eff = particleeffectnum(EFFECT_RIFLE_WEAK); + fireBullet_trace_callback_eff = EFFECT_RIFLE_WEAK; else - fireBullet_trace_callback_eff = particleeffectnum(EFFECT_BULLET); + fireBullet_trace_callback_eff = EFFECT_BULLET; float lag = ANTILAG_LATENCY(self); if(lag < 0.001) diff --git a/qcsrc/server/weapons/tracing.qh b/qcsrc/server/weapons/tracing.qh index b2ab7d082..c4f63835c 100644 --- a/qcsrc/server/weapons/tracing.qh +++ b/qcsrc/server/weapons/tracing.qh @@ -52,7 +52,7 @@ void W_SetupProjVelocity_Explicit(entity proj, vector dir, vector upDir, float p .vector railgunforce; void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, float mindist, float maxdist, float halflifedist, float forcehalflifedist, int deathtype); -float fireBullet_trace_callback_eff; +entity fireBullet_trace_callback_eff; entity fireBullet_last_hit; void fireBullet_trace_callback(vector start, vector hit, vector end); void fireBullet(vector start, vector dir, float spread, float max_solid_penetration, float damage, float force, float dtype, int tracereffects); -- 2.39.2