Fix tfcstats_pause imcomplete implementation (bug 5836, r=Nextra)

Former-commit-id: ea7b0f56fd
This commit is contained in:
Vincent Herbet 2013-08-07 16:46:40 +02:00
parent dca0bbcbb1
commit 225494b559
3 changed files with 15 additions and 6 deletions

View File

@ -161,7 +161,10 @@ void CPlayer::Init( int pi, edict_t* pe )
bot = false;
}
void CPlayer::saveKill(CPlayer* pVictim, int wweapon, int hhs, int ttk){
void CPlayer::saveKill(CPlayer* pVictim, int wweapon, int hhs, int ttk)
{
if (!isModuleActive())
return;
if ( ignoreBots(pEdict,pVictim->pEdict) )
return;
@ -218,7 +221,10 @@ void CPlayer::saveKill(CPlayer* pVictim, int wweapon, int hhs, int ttk){
life.tks += ttk;
}
void CPlayer::saveHit(CPlayer* pVictim, int wweapon, int ddamage, int bbody){
void CPlayer::saveHit(CPlayer* pVictim, int wweapon, int ddamage, int bbody)
{
if (!isModuleActive())
return;
if ( ignoreBots(pEdict,pVictim->pEdict) )
return;
@ -264,7 +270,10 @@ void CPlayer::saveHit(CPlayer* pVictim, int wweapon, int ddamage, int bbody){
life.bodyHits[bbody]++;
}
void CPlayer::saveShot(int weapon){
void CPlayer::saveShot(int weapon)
{
if (!isModuleActive())
return;
//PRINT_CONSOLE("Shot! Weapon:%d\n",weapon);

View File

@ -57,7 +57,7 @@ bool ignoreBots (edict_t *pEnt, edict_t *pOther)
}
bool isModuleActive(){
if ( !(int)CVAR_GET_FLOAT("tfcstats_pause") )
if (!(int)tfcstats_pause->value)
return true;
return false;
}

View File

@ -134,8 +134,8 @@ void ServerActivate_Post( edict_t *pEdictList, int edictCount, int clientMax ){
void PlayerPreThink_Post( edict_t *pEntity ) {
CPlayer *pPlayer = GET_PLAYER_POINTER(pEntity);
if ( !isModuleActive() ) // stats only
return;
if (!isModuleActive()) // stats only
RETURN_META(MRES_IGNORED);
if (pPlayer->clearStats && pPlayer->clearStats < gpGlobals->time && pPlayer->ingame){