]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/effects/qc/damageeffects.qc
Revert ceb39e77a "Optimize damageeffects code: when a hitscan weapon hits a surface...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / effects / qc / damageeffects.qc
index cb58a055c5dfcf2328479fcdc0ef13ce300c2452..20a335b6b8aac92dab451125497cabc9cec43d68 100644 (file)
@@ -18,7 +18,7 @@ bool Damage_DamageInfo_SendEntity(entity this, entity to, int sf)
        return true;
 }
 
-void Damage_DamageInfo(vector org, bool is_solid_hit, float coredamage, float edgedamage, float rad, vector force, int deathtype, float bloodtype, entity dmgowner)
+void Damage_DamageInfo(vector org, float coredamage, float edgedamage, float rad, vector force, int deathtype, float bloodtype, entity dmgowner)
 {
        // TODO maybe call this from non-edgedamage too?
        // TODO maybe make the client do the particle effects for the weapons and the impact sounds using this info?
@@ -39,8 +39,6 @@ void Damage_DamageInfo(vector org, bool is_solid_hit, float coredamage, float ed
        e.dmg_force = vlen(force);
        e.velocity = force;
        e.species = bloodtype;
-       if(is_solid_hit)
-               e.species |= 0x80;
 
        Net_LinkEntity(e, false, 0.2, Damage_DamageInfo_SendEntity);
 }
@@ -195,8 +193,6 @@ NET_HANDLE(ENT_CLIENT_DAMAGEINFO, bool isNew)
        edge = ReadByte();
        force = ReadVector();
        species = ReadByte();
-       bool is_solid_hit = (species & 0x80);
-       species = (species & 0x7F);
 
        return = true;
 
@@ -400,16 +396,11 @@ NET_HANDLE(ENT_CLIENT_DAMAGEINFO, bool isNew)
                w_random = prandom();
 
                vector force_dir = normalize(force);
-               if (is_solid_hit) // traceline not needed
-                       w_backoff = -force_dir;
+               traceline(w_org - force_dir * 16, w_org + force_dir * 16, MOVE_NOMONSTERS, NULL);
+               if(trace_fraction < 1 && !(hitwep.spawnflags & WEP_TYPE_HITSCAN))
+                       w_backoff = trace_plane_normal;
                else
-               {
-                       traceline(w_org - force_dir * 16, w_org + force_dir * 16, MOVE_NOMONSTERS, NULL);
-                       if(trace_fraction < 1 && !(hitwep.spawnflags & WEP_TYPE_HITSCAN))
-                               w_backoff = trace_plane_normal;
-                       else
-                               w_backoff = -force_dir;
-               }
+                       w_backoff = -force_dir;
                setorigin(this, w_org + w_backoff * 2); // for sound() calls
 
                if(!(trace_dphitq3surfaceflags & Q3SURFACEFLAG_SKY))