Use event HP and AP for hitmarker instead

This commit is contained in:
Kamay Xutax 2024-09-14 06:06:04 +02:00
parent 9292d41dfe
commit 578b623ccb

View file

@ -2540,21 +2540,18 @@ void C_CSPlayer::FireGameEvent( IGameEvent* event )
buffer_armor[0] = 0; buffer_armor[0] = 0;
} }
auto realHP = max( player->GetHealth() - health_damages, 0 );
auto realAP = max( player->ArmorValue() - armor_damages, 0 );
hudChat->Printf( CHAT_FILTER_NONE, hudChat->Printf( CHAT_FILTER_NONE,
"\7FFFFFF\x7" "\7FFFFFF\x7"
"FF00FF%s\x7" "FF00FF%s\x7"
"FFFFFF => \x7" "FFFFFF => \x7"
"FF0000%i HP \x7" "FF0000%i HP \x7"
"FFFFFF%s \7FFFFFF(\7FF0000%i HP \7FFFFFF- \x7" "FFFFFF%s \7FFFFFF(\7FF0000-%i HP \7FFFFFF & \x7"
"00FFFF%i AP\7FFFFFF)", "00FFFF-%i AP\7FFFFFF)",
player->GetPlayerName(), player->GetPlayerName(),
event->GetInt( "health" ),
event->GetInt( "armor" ),
health_damages, health_damages,
buffer_armor, armor_damages );
realHP,
realAP );
m_bHasHitPlayer = true; m_bHasHitPlayer = true;
} }