fixed wrong kills and deaths number

This commit is contained in:
Lukasz Wlasinksi 2004-09-15 08:25:07 +00:00
parent d7d8ba1398
commit fb7d1c0a7d

View File

@ -50,6 +50,7 @@ void Client_Damage(void* mValue){
static int TK; static int TK;
static int weapon; static int weapon;
static int aim; static int aim;
static bool ignore;
static CPlayer *pAttacker; static CPlayer *pAttacker;
switch (mState++) { switch (mState++) {
@ -60,7 +61,7 @@ void Client_Damage(void* mValue){
bits = *(int*)mValue; bits = *(int*)mValue;
break; break;
case 3: case 3:
if (!mPlayer || !damage || !*(float*)mValue || bits) break; if ( ignore = (!mPlayer || !damage || !*(float*)mValue || bits) ) break;
edict_t *enemy; edict_t *enemy;
enemy = mPlayer->pEdict->v.dmg_inflictor; enemy = mPlayer->pEdict->v.dmg_inflictor;
@ -81,12 +82,15 @@ void Client_Damage(void* mValue){
pAttacker->saveHit( mPlayer , weapon , damage, aim ); pAttacker->saveHit( mPlayer , weapon , damage, aim );
break; break;
case 4: case 4:
if ( ignore || mPlayer->IsAlive() )
break;
if ( !pAttacker ) if ( !pAttacker )
pAttacker = mPlayer; pAttacker = mPlayer;
TK = 0; TK = 0;
if ( (mPlayer->teamId == pAttacker->teamId) && (mPlayer != pAttacker) ) if ( (mPlayer->teamId == pAttacker->teamId) && (mPlayer != pAttacker) )
TK = 1; TK = 1;
pAttacker->saveKill(mPlayer,weapon,( aim == 1 ) ? 1:0 ,TK); pAttacker->saveKill(mPlayer,weapon,( aim == 1 ) ? 1:0 ,TK);
break; break;
} }
} }