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:
parent
a9b04f391f
commit
f6c7196408
@ -475,6 +475,7 @@ void PlayerManager::OnSourceModLevelEnd()
|
|||||||
OnClientDisconnect(m_Players[i].GetEdict());
|
OnClientDisconnect(m_Players[i].GetEdict());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
m_PlayerCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlayerManager::OnClientDisconnect(edict_t *pEntity)
|
void PlayerManager::OnClientDisconnect(edict_t *pEntity)
|
||||||
@ -491,7 +492,7 @@ void PlayerManager::OnClientDisconnect(edict_t *pEntity)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_Players[client].IsInGame())
|
if (m_Players[client].WasCountedAsInGame())
|
||||||
{
|
{
|
||||||
m_PlayerCount--;
|
m_PlayerCount--;
|
||||||
}
|
}
|
||||||
@ -884,6 +885,11 @@ bool CPlayer::IsInGame()
|
|||||||
return m_IsInGame && (m_pEdict->GetUnknown() != NULL);
|
return m_IsInGame && (m_pEdict->GetUnknown() != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CPlayer::WasCountedAsInGame()
|
||||||
|
{
|
||||||
|
return m_IsInGame;
|
||||||
|
}
|
||||||
|
|
||||||
bool CPlayer::IsConnected()
|
bool CPlayer::IsConnected()
|
||||||
{
|
{
|
||||||
return m_IsConnected;
|
return m_IsConnected;
|
||||||
|
@ -55,6 +55,7 @@ public:
|
|||||||
const char *GetAuthString();
|
const char *GetAuthString();
|
||||||
edict_t *GetEdict();
|
edict_t *GetEdict();
|
||||||
bool IsInGame();
|
bool IsInGame();
|
||||||
|
bool WasCountedAsInGame();
|
||||||
bool IsConnected();
|
bool IsConnected();
|
||||||
bool IsAuthorized();
|
bool IsAuthorized();
|
||||||
bool IsFakeClient();
|
bool IsFakeClient();
|
||||||
|
Loading…
Reference in New Issue
Block a user