whoa this caused a memory LEEK
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40274
This commit is contained in:
parent
d899b7a32a
commit
c4d8d30a39
@ -67,10 +67,14 @@ void CPlayerManager::OnSourceModShutdown()
|
||||
|
||||
void CPlayerManager::OnServerActivate(edict_t *pEdictList, int edictCount, int clientMax)
|
||||
{
|
||||
/* Initialize all players */
|
||||
m_maxClients = clientMax;
|
||||
m_PlayerCount = 0;
|
||||
m_Players = new CPlayer[m_maxClients + 1];
|
||||
if (m_FirstPass)
|
||||
{
|
||||
/* Initialize all players */
|
||||
m_maxClients = clientMax;
|
||||
m_PlayerCount = 0;
|
||||
m_Players = new CPlayer[m_maxClients + 1];
|
||||
m_FirstPass = false;
|
||||
}
|
||||
}
|
||||
|
||||
bool CPlayerManager::OnClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char *reject, int maxrejectlen)
|
||||
|
@ -11,6 +11,8 @@ class CPlayer;
|
||||
|
||||
class CPlayerManager : public SMGlobalClass
|
||||
{
|
||||
public:
|
||||
CPlayerManager() : m_FirstPass(true) {}
|
||||
public: //SMGlobalClass
|
||||
virtual void OnSourceModAllInitialized();
|
||||
virtual void OnSourceModShutdown();
|
||||
@ -38,6 +40,7 @@ private:
|
||||
CPlayer *m_Players;
|
||||
int m_maxClients;
|
||||
int m_PlayerCount;
|
||||
bool m_FirstPass;
|
||||
};
|
||||
|
||||
extern CPlayerManager g_PlayerManager;
|
||||
|
Loading…
Reference in New Issue
Block a user