From 728f1fcc67a04a8c9f3e3f46c865a7da001f0cea Mon Sep 17 00:00:00 2001 From: Javekson <132286351+Javekson@users.noreply.github.com> Date: Tue, 5 Sep 2023 07:53:22 +0400 Subject: [PATCH] Fixed of m_lastDamageAmount recording during armor calculation (#857) --- regamedll/dlls/player.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/regamedll/dlls/player.cpp b/regamedll/dlls/player.cpp index 398e987cc..fa26e4141 100644 --- a/regamedll/dlls/player.cpp +++ b/regamedll/dlls/player.cpp @@ -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)) @@ -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