From 0889fb8c0698cba8c004582c5df149356511f7ad Mon Sep 17 00:00:00 2001 From: terencehill Date: Mon, 5 Apr 2021 18:30:17 +0200 Subject: [PATCH] Correctly show particle fx and decal when an electro orb stuck on the ceiling explodes --- qcsrc/common/weapons/weapon/electro.qc | 4 ++++ qcsrc/common/weapons/weapon/minelayer.qc | 4 ++-- qcsrc/common/weapons/weapon/minelayer.qh | 1 - 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/qcsrc/common/weapons/weapon/electro.qc b/qcsrc/common/weapons/weapon/electro.qc index 86cab7048..9409819e9 100644 --- a/qcsrc/common/weapons/weapon/electro.qc +++ b/qcsrc/common/weapons/weapon/electro.qc @@ -49,6 +49,7 @@ void W_Electro_ExplodeCombo(entity this) W_Electro_TriggerCombo(this.origin, WEP_CVAR(electro, combo_comboradius), this.realowner); this.event_damage = func_null; + this.velocity = this.movedir; // particle fx and decals need .velocity RadiusDamage( this, @@ -78,6 +79,7 @@ void W_Electro_Explode(entity this, entity directhitentity) this.event_damage = func_null; this.takedamage = DAMAGE_NO; + this.velocity = this.movedir; // particle fx and decals need .velocity if(this.move_movetype == MOVETYPE_BOUNCE || this.classname == "electro_orb") // TODO: classname is more reliable anyway? { @@ -294,6 +296,8 @@ void W_Electro_Orb_Stick(entity this, entity to) setsize(newproj, this.mins, this.maxs); newproj.angles = vectoangles(-trace_plane_normal); // face against the surface + newproj.movedir = -trace_plane_normal; + newproj.takedamage = this.takedamage; newproj.damageforcescale = this.damageforcescale; SetResourceExplicit(newproj, RES_HEALTH, GetResource(this, RES_HEALTH)); diff --git a/qcsrc/common/weapons/weapon/minelayer.qc b/qcsrc/common/weapons/weapon/minelayer.qc index f9ff84653..6fbe11195 100644 --- a/qcsrc/common/weapons/weapon/minelayer.qc +++ b/qcsrc/common/weapons/weapon/minelayer.qc @@ -23,7 +23,7 @@ void W_MineLayer_Stick(entity this, entity to) setsize(newmine, '-4 -4 -4', '4 4 4'); newmine.angles = vectoangles(-trace_plane_normal); // face against the surface - newmine.mine_orientation = -trace_plane_normal; + newmine.movedir = -trace_plane_normal; newmine.takedamage = this.takedamage; newmine.damageforcescale = this.damageforcescale; @@ -92,7 +92,7 @@ void W_MineLayer_DoRemoteExplode(entity this) this.takedamage = DAMAGE_NO; if(this.move_movetype == MOVETYPE_NONE || this.move_movetype == MOVETYPE_FOLLOW) - this.velocity = this.mine_orientation; // particle fx and decals need .velocity + this.velocity = this.movedir; // particle fx and decals need .velocity RadiusDamage(this, this.realowner, WEP_CVAR(minelayer, remote_damage), WEP_CVAR(minelayer, remote_edgedamage), WEP_CVAR(minelayer, remote_radius), NULL, NULL, WEP_CVAR(minelayer, remote_force), this.projectiledeathtype | HITTYPE_BOUNCE, this.weaponentity_fld, NULL); diff --git a/qcsrc/common/weapons/weapon/minelayer.qh b/qcsrc/common/weapons/weapon/minelayer.qh index dc79d74ac..b34ef9dd4 100644 --- a/qcsrc/common/weapons/weapon/minelayer.qh +++ b/qcsrc/common/weapons/weapon/minelayer.qh @@ -62,7 +62,6 @@ SPAWNFUNC_WEAPON(weapon_minelayer, WEP_MINE_LAYER) void W_MineLayer_Think(entity this); .float minelayer_detonate, mine_explodeanyway; .float mine_time; -.vector mine_orientation; IntrusiveList g_mines; STATIC_INIT(g_mines) { g_mines = IL_NEW(); } -- 2.39.2