From: terencehill Date: Mon, 5 Apr 2021 16:30:17 +0000 (+0200) Subject: Correctly show particle fx and decal when an electro orb stuck on the ceiling explodes X-Git-Tag: xonotic-v0.8.5~466 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0889fb8c;p=xonotic%2Fxonotic-data.pk3dir.git Correctly show particle fx and decal when an electro orb stuck on the ceiling explodes --- 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(); }