diff --git a/dlls/cstrike/csx/CMisc.cpp b/dlls/cstrike/csx/CMisc.cpp index da8dfd1e..28f71306 100755 --- a/dlls/cstrike/csx/CMisc.cpp +++ b/dlls/cstrike/csx/CMisc.cpp @@ -67,13 +67,19 @@ void CPlayer::Disconnect(){ if ( ignoreBots(pEdict) || !isModuleActive() ) // ignore if he is bot and bots rank is disabled or module is paused return; - rank->updatePosition( &life ); + if (rank != 0) // Just a sanity check, FL_FAKECLIENT is notoriously unreliable. + { + rank->updatePosition( &life ); + } + rank = 0; } void CPlayer::PutInServer(){ - if ( ignoreBots(pEdict) ) + //if ( ignoreBots(pEdict) ) + if ( (int)csstats_rankbots->value == 0 && + IsBot() ) return; restartStats(); diff --git a/dlls/cstrike/csx/CMisc.h b/dlls/cstrike/csx/CMisc.h index 6dac8ca5..e2b565a8 100755 --- a/dlls/cstrike/csx/CMisc.h +++ b/dlls/cstrike/csx/CMisc.h @@ -58,7 +58,8 @@ struct CPlayer { void restartStats(bool all = true); inline bool IsBot(){ const char* auth= (*g_engfuncs.pfnGetPlayerAuthId)(pEdict); - return ( auth && !strcmp( auth , "BOT" ) ); + return ( (auth && !strcmp( auth , "BOT" )) || // AuthID of "BOT" + (pEdict->v.flags & FL_FAKECLIENT)); // FL_FAKECLIENT flag set } inline bool IsAlive(){ return ((pEdict->v.deadflag==DEAD_NO)&&(pEdict->v.health>0));