TraceAttack: Accumulate trace_surface_id's into g_multiDamage_HitBod

so we keep track of which body types we hit
This commit is contained in:
Marco Cawthorne 2021-10-16 21:28:03 +02:00
parent 70fe95e5a7
commit e53a7a33e2
Signed by: eukara
GPG key ID: C196CD8BA993248A

View file

@ -16,6 +16,7 @@
entity g_multiDamage_Target;
int g_multiDamage_Value;
int g_multiDamage_HitBod;
static void
TraceAttack_Apply(entity eAttacker, int iWeapon)
@ -28,9 +29,11 @@ TraceAttack_Apply(entity eAttacker, int iWeapon)
FX_Blood(trace_endpos, [1,0,0]);
}
trace_surface_id = g_multiDamage_HitBod;
Damage_Apply(g_multiDamage_Target, self, g_multiDamage_Value, iWeapon, DMG_BULLET);
g_multiDamage_Target = __NULL__;
g_multiDamage_Value = 0;
g_multiDamage_HitBod = 0;
}
void
@ -52,6 +55,7 @@ TraceAttack_FireSingle(vector vecPos, vector vAngle, int iDamage, int iWeapon)
self.hitcontentsmaski = CONTENTBITS_POINTSOLID | CONTENTBIT_CORPSE;
traceline(vecPos, vecPos + range, MOVE_LAGGED | MOVE_HITMODEL, self);
self.hitcontentsmaski = oldhitcontents;
g_multiDamage_HitBod |= trace_surface_id;
if (trace_fraction >= 1.0f)
return;