damage message changes

This commit is contained in:
Lukasz Wlasinksi 2004-12-02 02:11:09 +00:00
parent c4727c1dc3
commit 2baf9c4c20

View File

@ -7,12 +7,14 @@ int damage;
int TA; int TA;
int weapon; int weapon;
int aim; int aim;
bool ignore;
CPlayer *pAttacker; CPlayer *pAttacker;
void Client_ResetHUD(void* mValue){ void Client_ResetHUD(void* mValue){
if ( mPlayer ) if ( mPlayer ){
mPlayer->clearStats = gpGlobals->time + 0.25f; mPlayer->clearStats = gpGlobals->time + 0.25f;
}
} }
void Client_WeaponList(void* mValue){ void Client_WeaponList(void* mValue){
@ -50,18 +52,25 @@ void Client_Damage(void* mValue){
static int bits; static int bits;
switch (mState++) { switch (mState++) {
case 1: case 1:
ignore = false;
damage = *(int*)mValue; damage = *(int*)mValue;
break; break;
case 2: case 2:
bits = *(int*)mValue; bits = *(int*)mValue;
break; break;
case 3: case 3:
if (!mPlayer || !damage || !*(float*)mValue || bits) break; if (!mPlayer || !damage || !*(float*)mValue || bits) {
ignore = true;
break;
}
edict_t *enemy; edict_t *enemy;
enemy = mPlayer->pEdict->v.dmg_inflictor; enemy = mPlayer->pEdict->v.dmg_inflictor;
if ( FNullEnt( enemy ) ) if ( FNullEnt( enemy ) ){
ignore = true;
break; break;
}
aim = 0; aim = 0;
weapon = 0; weapon = 0;
pAttacker = NULL; pAttacker = NULL;
@ -81,7 +90,7 @@ void Client_Damage(void* mValue){
} }
void Client_Damage_End(void* mValue){ void Client_Damage_End(void* mValue){
if ( !mPlayer || !damage ) if ( ignore )
return; return;
if ( !pAttacker ) pAttacker = mPlayer; if ( !pAttacker ) pAttacker = mPlayer;
@ -204,3 +213,4 @@ void Client_BarTime(void* mValue){
g_bombAnnounce = BOMB_DEFUSING; g_bombAnnounce = BOMB_DEFUSING;
} }
} }