From 0bd7df86672622ca72763e10a3c23528c2f169a7 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 26 Sep 2007 13:14:41 +0000 Subject: [PATCH] made new playerhelpers api backwards compatible; added note about server activation and maxclients --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401492 --- core/PlayerManager.cpp | 5 ++++- public/IPlayerHelpers.h | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/core/PlayerManager.cpp b/core/PlayerManager.cpp index 9eb23a500..f53e9c343 100644 --- a/core/PlayerManager.cpp +++ b/core/PlayerManager.cpp @@ -199,7 +199,10 @@ void PlayerManager::OnServerActivate(edict_t *pEdictList, int edictCount, int cl List::iterator iter; for (iter = m_hooks.begin; iter != m_hooks.end(); iter++) { - (*iter)->OnServerActivated(clientMax); + if ((*iter)->GetClientListenerVersion() >= 5) + { + (*iter)->OnServerActivated(clientMax); + } } g_OnMapStarted = true; diff --git a/public/IPlayerHelpers.h b/public/IPlayerHelpers.h index bf02dcf39..0071d93dc 100644 --- a/public/IPlayerHelpers.h +++ b/public/IPlayerHelpers.h @@ -277,6 +277,8 @@ namespace SourceMod /** * @brief Returns the maximum number of clients. * + * Note: this will not work until the server is activated. + * * @return Maximum number of clients. */ virtual int GetMaxClients() =0;