diff --git a/src/game/client/tf/tf_hud_account.cpp b/src/game/client/tf/tf_hud_account.cpp index 20070cff5af..3988113f964 100644 --- a/src/game/client/tf/tf_hud_account.cpp +++ b/src/game/client/tf/tf_hud_account.cpp @@ -524,16 +524,13 @@ class CDamageAccountPanel : public CHudAccountPanel //----------------------------------------------------------------------------- void DisplayDamageFeedback( CTFPlayer *pAttacker, CBaseCombatCharacter *pVictim, int iDamage, int iHealth, bool bIsCrit ) { - if ( iDamage <= 0 ) // zero value (invuln?) + if ( iDamage <= 0 || !pAttacker ) return; CTFPlayer *pLocalPlayer = C_TFPlayer::GetLocalTFPlayer(); if ( !pLocalPlayer || !pLocalPlayer->IsAlive() ) return; - if ( !pAttacker || !pVictim ) - return; - // Show the attacker, or when healing the player that is if ( ( pAttacker == pLocalPlayer ) || ( pLocalPlayer->IsPlayerClass( TF_CLASS_MEDIC ) && ( pLocalPlayer->MedicGetHealTarget() == pAttacker ) ) ) @@ -617,7 +614,7 @@ class CDamageAccountPanel : public CHudAccountPanel } } - if ( hud_combattext.GetBool() ) + if ( hud_combattext.GetBool() && pVictim ) { // Ignore damage events on targets that we can't see, so it's not a cheat trace_t tr; diff --git a/src/game/server/tf/tf_obj.cpp b/src/game/server/tf/tf_obj.cpp index c7a9e93a0a2..9a499888db0 100644 --- a/src/game/server/tf/tf_obj.cpp +++ b/src/game/server/tf/tf_obj.cpp @@ -2055,7 +2055,7 @@ int CBaseObject::OnTakeDamage( const CTakeDamageInfo &info ) if ( event ) { event->SetInt( "entindex", entindex() ); - event->SetInt( "health", Max( 0, (int)GetHealth() ) ); + event->SetInt( "health", Max( 0, (int)ceil( GetHealth() ) ) ); event->SetInt( "damageamount", flDamage ); event->SetBool( "crit", ( info.GetDamageType() & DMG_CRITICAL ) ? true : false );