Server: Add new global g_dmg_vecLocation, which gives an approximate damage impact location.

Documentation
Marco Cawthorne 1 year ago
parent 1b6cb974ed
commit 5f126516c6
Signed by: eukara
GPG Key ID: CE2032F0A2882A22

@ -417,6 +417,7 @@ NSGameRules::DamageRadius(vector org, entity attacker, float dmg, float r, int c
new_dmg = rint(dmg * diff);
if (diff > 0) {
g_dmg_vecLocation = org;
DamageApply(e, attacker, new_dmg, w, DMG_EXPLODE);
/* approximate, feel free to tweak */

@ -21,11 +21,13 @@ NSTraceAttack::_ApplyDamage(void)
if (m_eMultiTarget == __NULL__)
return;
if (trace_ent.iBleeds == 1) {
/* the location _could_ be more accurate... */
if (m_eMultiTarget.iBleeds == 1) {
FX_Blood(trace_endpos, [0.5,0,0]);
}
trace_surface_id = m_iMultiBody;
g_dmg_vecLocation = trace_endpos;
Damage_Apply(m_eMultiTarget, m_eOwner, m_iMultiValue, m_iWeapon, DMG_BULLET);
m_eMultiTarget = __NULL__;
m_iMultiValue = 0;

@ -139,6 +139,7 @@ int g_dmg_iRealDamage;
bodyType_t g_dmg_iHitBody;
int g_dmg_iFlags;
int g_dmg_iWeapon;
vector g_dmg_vecLocation;
var bool g_ents_initialized = FALSE;

@ -1079,7 +1079,7 @@ NSClientPlayer::Footsteps_Update(void)
step_time = time + 0.35;
//tracebox(origin, PHY_HULL_MIN, PHY_HULL_MAX, origin + [0,0,-48], MOVE_NORMAL, target);
traceline(origin + view_ofs, origin + [0,0,-48], FALSE, this);
traceline(origin + view_ofs, origin + [0,0,-48], MOVE_NORMAL, this);
tex_name = getsurfacetexture(trace_ent, getsurfacenearpoint(trace_ent, trace_endpos));
if (!(GetFlags() & FL_ONGROUND) && (!GetFlags() & FL_ONLADDER)) {

Loading…
Cancel
Save