fixed a bug where the player count could be trashed across bad mapchanges. additionally, it gets hard reset on mapchange as a safety precaution.

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401364
This commit is contained in:
David Anderson 2007-08-19 15:47:53 +00:00
parent a9b04f391f
commit f6c7196408
2 changed files with 8 additions and 1 deletions

View File

@ -475,6 +475,7 @@ void PlayerManager::OnSourceModLevelEnd()
OnClientDisconnect(m_Players[i].GetEdict());
}
}
m_PlayerCount = 0;
}
void PlayerManager::OnClientDisconnect(edict_t *pEntity)
@ -491,7 +492,7 @@ void PlayerManager::OnClientDisconnect(edict_t *pEntity)
return;
}
if (m_Players[client].IsInGame())
if (m_Players[client].WasCountedAsInGame())
{
m_PlayerCount--;
}
@ -884,6 +885,11 @@ bool CPlayer::IsInGame()
return m_IsInGame && (m_pEdict->GetUnknown() != NULL);
}
bool CPlayer::WasCountedAsInGame()
{
return m_IsInGame;
}
bool CPlayer::IsConnected()
{
return m_IsConnected;

View File

@ -55,6 +55,7 @@ public:
const char *GetAuthString();
edict_t *GetEdict();
bool IsInGame();
bool WasCountedAsInGame();
bool IsConnected();
bool IsAuthorized();
bool IsFakeClient();