From 88a1cbdbdb017e093a1b81ac90b859c8ddb55478 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 18 Dec 2014 18:57:04 +1100 Subject: [PATCH] Add a hack to explode nades when they touch the void, don't remove nades when they hit player clips, still remove nades when they hit sky, fix deathmatch nade explosion effect --- effectinfo.txt | 18 +++++++++--------- qcsrc/server/miscfunctions.qc | 2 +- qcsrc/server/mutators/mutator_nades.qc | 19 +++++++++++++++++-- 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/effectinfo.txt b/effectinfo.txt index 63d808886..c79e2d6d0 100644 --- a/effectinfo.txt +++ b/effectinfo.txt @@ -8829,7 +8829,7 @@ originjitter 64 64 64 velocityjitter 324 324 324 rotate -180 180 -100 100 -effect nade_explode +effect nade_neutral_explode countabsolute 1 type decal tex 8 16 @@ -8840,7 +8840,7 @@ lightradius 300 lightradiusfade 1500 lightcolor 100 20 20 // shockwave -effect nade_explode +effect nade_neutral_explode type smoke countabsolute 1 tex 33 33 @@ -8850,7 +8850,7 @@ color 0xff0000 0xffa2a2 alpha 80 80 650 velocitymultiplier 44 // fire -effect nade_explode +effect nade_neutral_explode notunderwater count 16 type smoke @@ -8864,7 +8864,7 @@ originjitter 50 50 50 velocityjitter 320 320 320 rotate -180 180 -9 9 // fire stretched -effect nade_explode +effect nade_neutral_explode count 8 type spark tex 48 55 @@ -8876,7 +8876,7 @@ sizeincrease 40 velocityjitter 30 30 30 airfriction -9 //smoke -effect nade_explode +effect nade_neutral_explode type smoke count 32 blend alpha @@ -8892,7 +8892,7 @@ sizeincrease 50 airfriction 0.04 gravity 0.4 // underwater bubbles -effect nade_explode +effect nade_neutral_explode underwater count 32 type bubble @@ -8907,7 +8907,7 @@ originjitter 16 16 16 velocityjitter 196 196 196 rotate 0 0 0 0 // bouncing sparks -effect nade_explode +effect nade_neutral_explode notunderwater count 8 type spark @@ -8923,7 +8923,7 @@ velocityoffset 0 0 80 originjitter 16 16 16 velocityjitter 424 424 624 // notbouncing sparks -effect nade_explode +effect nade_neutral_explode count 16 type spark tex 40 40 @@ -8937,7 +8937,7 @@ velocityoffset 0 0 80 originjitter 16 16 16 velocityjitter 424 424 624 // debris -effect nade_explode +effect nade_neutral_explode notunderwater count 8 type smoke diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index 71294f194..5f6b6a9dd 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -1769,7 +1769,7 @@ float WarpZone_Projectile_Touch_ImpactFilter_Callback() W_Crylink_Dequeue(self); remove(self); } - else + else if(self.classname != "nade") // nade handles itself manually remove(self); return TRUE; } diff --git a/qcsrc/server/mutators/mutator_nades.qc b/qcsrc/server/mutators/mutator_nades.qc index c7697842d..47eb24875 100644 --- a/qcsrc/server/mutators/mutator_nades.qc +++ b/qcsrc/server/mutators/mutator_nades.qc @@ -520,7 +520,8 @@ void nade_boom() } } - pointparticles(particleeffectnum(expef), self.origin + '0 0 1', '0 0 0', 1); + if(expef != "") + pointparticles(particleeffectnum(expef), findbetterlocation(self.origin, 8), '0 0 0', 1); sound(self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTEN_NORM); sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM); @@ -532,6 +533,7 @@ void nade_boom() Damage_DamageInfo(self.origin, autocvar_g_nades_nade_damage, autocvar_g_nades_nade_edgedamage, autocvar_g_nades_nade_radius, '1 1 1' * autocvar_g_nades_nade_force, self.projectiledeathtype, 0, self); } + if(self.health != -1337) switch ( self.nade_type ) { case NADE_TYPE_NAPALM: nade_napalm_boom(); break; @@ -547,8 +549,14 @@ void nade_boom() void nade_touch() { - if(trace_dphitcontents & (DPCONTENTS_PLAYERCLIP | DPCONTENTS_MONSTERCLIP)) { return; } + if(ITEM_TOUCH_NEEDKILL()) + { + remove(self); + return; + } + PROJECTILE_TOUCH; + //setsize(self, '-2 -2 -2', '2 2 2'); //UpdateCSQCProjectile(self); if(self.health == self.max_health) @@ -570,6 +578,13 @@ void nade_beep() void nade_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force) { + if(ITEM_DAMAGE_NEEDKILL(deathtype)) + { + self.health = -1337; // hack + nade_boom(); + return; + } + if(self.nade_type == NADE_TYPE_TRANSLOCATE || self.nade_type == NADE_TYPE_SPAWN) return; -- 2.39.2