From 2baf9c4c207794e4b0db4e90b280e2319000619c Mon Sep 17 00:00:00 2001 From: Lukasz Wlasinksi Date: Thu, 2 Dec 2004 02:11:09 +0000 Subject: [PATCH] damage message changes --- dlls/csx/source/usermsg.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/dlls/csx/source/usermsg.cpp b/dlls/csx/source/usermsg.cpp index ee03e9e9..63f81ba8 100755 --- a/dlls/csx/source/usermsg.cpp +++ b/dlls/csx/source/usermsg.cpp @@ -7,12 +7,14 @@ int damage; int TA; int weapon; int aim; +bool ignore; CPlayer *pAttacker; void Client_ResetHUD(void* mValue){ - if ( mPlayer ) + if ( mPlayer ){ mPlayer->clearStats = gpGlobals->time + 0.25f; + } } void Client_WeaponList(void* mValue){ @@ -50,22 +52,29 @@ void Client_Damage(void* mValue){ static int bits; switch (mState++) { case 1: + ignore = false; damage = *(int*)mValue; break; case 2: bits = *(int*)mValue; break; case 3: - if (!mPlayer || !damage || !*(float*)mValue || bits) break; + if (!mPlayer || !damage || !*(float*)mValue || bits) { + ignore = true; + break; + } edict_t *enemy; enemy = mPlayer->pEdict->v.dmg_inflictor; - if ( FNullEnt( enemy ) ) + if ( FNullEnt( enemy ) ){ + ignore = true; break; + } + aim = 0; weapon = 0; pAttacker = NULL; - + if (enemy->v.flags & (FL_CLIENT | FL_FAKECLIENT) ) { pAttacker = GET_PLAYER_POINTER(enemy); aim = pAttacker->aiming; @@ -81,7 +90,7 @@ void Client_Damage(void* mValue){ } void Client_Damage_End(void* mValue){ - if ( !mPlayer || !damage ) + if ( ignore ) return; if ( !pAttacker ) pAttacker = mPlayer; @@ -203,4 +212,5 @@ void Client_BarTime(void* mValue){ g_Defuser = mPlayerIndex; g_bombAnnounce = BOMB_DEFUSING; } -} \ No newline at end of file +} +