Skip to content

Commit

Permalink
Fixed of m_lastDamageAmount recording during armor calculation (#857)
Browse files Browse the repository at this point in the history
  • Loading branch information
Javekson authored Sep 5, 2023
1 parent e8bff71 commit 728f1fc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions regamedll/dlls/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1153,9 +1153,6 @@ BOOL EXT_FUNC CBasePlayer::__API_HOOK(TakeDamage)(entvars_t *pevInflictor, entva
}
}

// keep track of amount of damage last sustained
m_lastDamageAmount = flDamage;

// Armor
// armor doesn't protect against fall or drown damage!
if (pev->armorvalue != 0.0f && !(bitsDamageType & (DMG_DROWN | DMG_FALL)) && IsArmored(m_LastHitGroup))
Expand Down Expand Up @@ -1194,7 +1191,10 @@ BOOL EXT_FUNC CBasePlayer::__API_HOOK(TakeDamage)(entvars_t *pevInflictor, entva
{
Pain(m_LastHitGroup, false);
}


// keep track of amount of damage last sustained
m_lastDamageAmount = flDamage;

LogAttack(pAttack, this, bTeamAttack, flDamage, armorHit, pev->health - flDamage, pev->armorvalue, GetWeaponName(pevInflictor, pevAttacker));

// this cast to INT is critical!!! If a player ends up with 0.5 health, the engine will get that
Expand Down

0 comments on commit 728f1fc

Please sign in to comment.