diff --git a/core/PlayerManager.cpp b/core/PlayerManager.cpp index 79cd0474..8c114c5b 100644 --- a/core/PlayerManager.cpp +++ b/core/PlayerManager.cpp @@ -274,7 +274,7 @@ void PlayerManager::OnServerActivate(edict_t *pEdictList, int edictCount, int cl SM_ExecuteAllConfigs(); } -bool PlayerManager::IsServerActivated() const +bool PlayerManager::IsServerActivated() { return m_FirstPass; } @@ -856,7 +856,7 @@ int PlayerManager::GetMaxClients() CPlayer *PlayerManager::GetPlayerByIndex(int client) const { - if (!IsServerActivated() || client > gpGlobals->maxClients || client < 1) + if (client > gpGlobals->maxClients || client < 1) { return NULL; } @@ -937,12 +937,6 @@ IGamePlayer *PlayerManager::GetGamePlayer(int client) void PlayerManager::ClearAdminId(AdminId id) { - // Players may not be inited if server hasn't yet been activated - if (!IsServerActivated()) - { - return; - } - int maxClients = gpGlobals->maxClients; for (int i=1; i<=maxClients; i++) { @@ -955,8 +949,8 @@ void PlayerManager::ClearAdminId(AdminId id) void PlayerManager::ClearAllAdmins() { - // Players may not be inited if server hasn't yet been activated - if (!IsServerActivated()) + // Players may not be inited if server hadn't been activated + if (!m_Players) { return; } @@ -975,8 +969,8 @@ const char *PlayerManager::GetPassInfoVar() void PlayerManager::RecheckAnyAdmins() { - // Players may not be inited if server hasn't yet been activated - if (!IsServerActivated()) + // Players may not be inited if server hadn't been activated + if (!m_Players) { return; } diff --git a/core/PlayerManager.h b/core/PlayerManager.h index 1bc6a22d..7c88e1a2 100644 --- a/core/PlayerManager.h +++ b/core/PlayerManager.h @@ -161,7 +161,7 @@ public: //IPlayerManager int GetMaxClients(); int GetNumPlayers(); int GetClientOfUserId(int userid); - bool IsServerActivated() const; + bool IsServerActivated(); int FilterCommandTarget(IGamePlayer *pAdmin, IGamePlayer *pTarget, int flags); int InternalFilterCommandTarget(CPlayer *pAdmin, CPlayer *pTarget, int flags); void RegisterCommandTargetProcessor(ICommandTargetProcessor *pHandler); diff --git a/public/IPlayerHelpers.h b/public/IPlayerHelpers.h index bb7a1c9c..54855899 100644 --- a/public/IPlayerHelpers.h +++ b/public/IPlayerHelpers.h @@ -41,7 +41,7 @@ #include #define SMINTERFACE_PLAYERMANAGER_NAME "IPlayerManager" -#define SMINTERFACE_PLAYERMANAGER_VERSION 15 +#define SMINTERFACE_PLAYERMANAGER_VERSION 14 struct edict_t; class IPlayerInfo; @@ -489,7 +489,7 @@ namespace SourceMod * @return True if ServerActivate() has been called * at least once, false otherwise. */ - virtual bool IsServerActivated() const =0; + virtual bool IsServerActivated() =0; /** * @brief Gets SourceMod's reply source.