diff --git a/dlls/csstats2/csstats/CMisc.cpp b/dlls/csstats2/csstats/CMisc.cpp index 8350b326..ba02bbc3 100755 --- a/dlls/csstats2/csstats/CMisc.cpp +++ b/dlls/csstats2/csstats/CMisc.cpp @@ -91,7 +91,6 @@ void CPlayer::PutInServer(){ } void CPlayer::Connect(const char* address ){ - bot = IsBot(); strcpy(ip,address); rank = 0; clearStats = 0.0f; diff --git a/dlls/csstats2/csstats/CMisc.h b/dlls/csstats2/csstats/CMisc.h index 1aff4c81..6cbae1bf 100755 --- a/dlls/csstats2/csstats/CMisc.h +++ b/dlls/csstats2/csstats/CMisc.h @@ -21,7 +21,6 @@ struct CPlayer { int index; int aiming; int current; - bool bot; float clearStats; RankSystem::RankStats* rank; diff --git a/dlls/dod2/dodfun/CMisc.cpp b/dlls/dod2/dodfun/CMisc.cpp index 48d990b3..2542add2 100755 --- a/dlls/dod2/dodfun/CMisc.cpp +++ b/dlls/dod2/dodfun/CMisc.cpp @@ -38,7 +38,7 @@ // ***************************************************** void CPlayer::Disconnect(){ - ingame = staminaSet = fuseSet = false; + ingame = staminaSet = fuseSet = bot = false; } void CPlayer::PutInServer(){ @@ -55,7 +55,7 @@ void CPlayer::Init( int pi, edict_t* pe ) pEdict = pe; index = pi; current = 0; - ingame = staminaSet = false; + ingame = staminaSet = fuseSet = bot = false; } diff --git a/dlls/dod2/dodx/CMisc.cpp b/dlls/dod2/dodx/CMisc.cpp index 7b69fd45..8704f588 100755 --- a/dlls/dod2/dodx/CMisc.cpp +++ b/dlls/dod2/dodx/CMisc.cpp @@ -90,6 +90,7 @@ void Grenades::clear() void CPlayer::Disconnect(){ ingame = false; + bot = false; savedScore = 0; if ( ignoreBots(pEdict) || !isModuleActive() ) // ignore if he is bot and bots rank is disabled or module is paused @@ -150,6 +151,7 @@ void CPlayer::Init( int pi, edict_t* pe ) current = 0; clearStats = 0.0f; ingame = false; + bot = false; savedScore = 0; } diff --git a/dlls/dod2/dodx/moduleconfig.cpp b/dlls/dod2/dodx/moduleconfig.cpp index 147ff7f5..98917a6a 100755 --- a/dlls/dod2/dodx/moduleconfig.cpp +++ b/dlls/dod2/dodx/moduleconfig.cpp @@ -195,13 +195,13 @@ void ServerDeactivate() { BOOL ClientConnect_Post( edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ] ){ GET_PLAYER_POINTER(pEntity)->Connect(pszName,pszAddress); - + RETURN_META_VALUE(MRES_IGNORED, TRUE); } void ClientDisconnect( edict_t *pEntity ) { CPlayer *pPlayer = GET_PLAYER_POINTER(pEntity); - + if (pPlayer->ingame) pPlayer->Disconnect(); diff --git a/dlls/tfc/tfcx/CMisc.cpp b/dlls/tfc/tfcx/CMisc.cpp index c938a295..afd50ed6 100755 --- a/dlls/tfc/tfcx/CMisc.cpp +++ b/dlls/tfc/tfcx/CMisc.cpp @@ -93,6 +93,7 @@ void Grenades::clear() void CPlayer::Disconnect(){ ingame = false; + bot = false; if ( ignoreBots(pEdict) || !isModuleActive() ) // ignore if he is bot and bots rank is disabled or module is paused return; @@ -145,6 +146,8 @@ void CPlayer::Init( int pi, edict_t* pe ) current = 0; clearStats = 0.0f; rank = 0; + ingame = false; + bot = false; } void CPlayer::saveKill(CPlayer* pVictim, int wweapon, int hhs, int ttk){ diff --git a/dlls/ts/tsx/CMisc.cpp b/dlls/ts/tsx/CMisc.cpp index 3a876d5d..44321075 100755 --- a/dlls/ts/tsx/CMisc.cpp +++ b/dlls/ts/tsx/CMisc.cpp @@ -75,7 +75,6 @@ void CPlayer::PutInServer(){ ingame = false; } void CPlayer::Connect( const char* ippp ){ - bot = IsBot(); strcpy(ip,ippp); } diff --git a/dlls/ts/tsx/CMisc.h b/dlls/ts/tsx/CMisc.h index 923dde29..fff275ad 100755 --- a/dlls/ts/tsx/CMisc.h +++ b/dlls/ts/tsx/CMisc.h @@ -90,7 +90,6 @@ struct CPlayer { int frags; // suma dla kontroli ostatniego fraga, to - v.frags = lastfrag bool ingame; - bool bot; float clearStats; struct PlayerWeapon : public Stats { @@ -117,6 +116,7 @@ struct CPlayer { void saveHit(CPlayer* pVictim, int weapon, int damage, int aiming); void saveShot(int weapon); void restartStats(bool all = true); + inline bool IsBot(){ const char* auth= (*g_engfuncs.pfnGetPlayerAuthId)(pEdict); return ( auth && !strcmp( auth , "BOT" ) ); diff --git a/dlls/ts/tsx/moduleconfig.cpp b/dlls/ts/tsx/moduleconfig.cpp index 76677718..4b9ae50c 100755 --- a/dlls/ts/tsx/moduleconfig.cpp +++ b/dlls/ts/tsx/moduleconfig.cpp @@ -188,7 +188,7 @@ void ClientUserInfoChanged_Post( edict_t *pEntity, char *infobuffer ) { const char* name = INFOKEY_VALUE(infobuffer,"name"); const char* oldname = STRING(pEntity->v.netname); - if ( pPlayer->ingame){ + if ( pPlayer->ingame ){ if ( strcmp(oldname,name) ) { if (!tsstats_rank->value) pPlayer->rank = g_rank.findEntryInRank( name, name ); @@ -197,7 +197,6 @@ void ClientUserInfoChanged_Post( edict_t *pEntity, char *infobuffer ) { } } else if ( pPlayer->IsBot() ) { - pPlayer->Connect( "127.0.0.1" ); pPlayer->PutInServer(); }