From e762c2ee5630c0ce16658e3c0dfafaf5c04541dd Mon Sep 17 00:00:00 2001 From: Nicholas Hastings Date: Fri, 23 Jun 2017 11:15:23 -0400 Subject: [PATCH] Add support for IClient lookups on SDK 2013 mods with new enough engine. --- core/PlayerManager.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/PlayerManager.cpp b/core/PlayerManager.cpp index d00273d2..802ea544 100644 --- a/core/PlayerManager.cpp +++ b/core/PlayerManager.cpp @@ -1967,6 +1967,13 @@ void CPlayer::Initialize(const char *name, const char *ip, edict_t *pEntity) || SOURCE_ENGINE == SE_BMS \ || SOURCE_ENGINE == SE_INSURGENCY m_pIClient = engine->GetIServer()->GetClient(m_iIndex - 1); +#elif SOURCE_ENGINE == SE_SDK2013 + // Source SDK 2013 mods that ship on Steam can be using older engine binaries + static IVEngineServer *engine22 = (IVEngineServer *)(g_SMAPI->GetEngineFactory()("VEngineServer022", nullptr)); + if (engine22) + { + m_pIClient = engine22->GetIServer()->GetClient(m_iIndex - 1); + } #else INetChannel *pNetChan = static_cast(engine->GetPlayerNetInfo(m_iIndex)); if (pNetChan)