]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Correctly show particle fx and decal when an electro orb stuck on the ceiling explodes
authorterencehill <piuntn@gmail.com>
Mon, 5 Apr 2021 16:30:17 +0000 (18:30 +0200)
committerterencehill <piuntn@gmail.com>
Mon, 5 Apr 2021 16:30:17 +0000 (18:30 +0200)
qcsrc/common/weapons/weapon/electro.qc
qcsrc/common/weapons/weapon/minelayer.qc
qcsrc/common/weapons/weapon/minelayer.qh

index 86cab70486cd8c86617e9166baf598d70209d51a..9409819e9c15b8569fa5623ede91e841984224dc 100644 (file)
@@ -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));
index f9ff84653a63ffa3f499cff7fa20e905203f1e6a..6fbe11195653b73ab0ac5dc5553cf86d59504fa6 100644 (file)
@@ -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);
index dc79d74ac70ab380798bed7b2ab602a6aef3d248..b34ef9dd4171f9e88eed0bb9da3449730a074961 100644 (file)
@@ -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(); }