]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapon/electro.qc
Save global trace values when performing touch operations as touches may perform...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / electro.qc
index 86cab70486cd8c86617e9166baf598d70209d51a..1142bff9d287bc0e864b203051a146227efbd0cf 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?
        {
@@ -128,7 +130,7 @@ void W_Electro_TouchExplode(entity this, entity toucher)
 }
 
 
-void sys_phys_update_single(entity this);
+//void sys_phys_update_single(entity this);
 
 void W_Electro_Bolt_Think(entity this)
 {
@@ -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));