Add support for IClient lookups on SDK 2013 mods with new enough engine.

This commit is contained in:
Nicholas Hastings 2017-06-23 11:15:23 -04:00
parent c31eaa01a3
commit e762c2ee56

View File

@ -1967,6 +1967,13 @@ void CPlayer::Initialize(const char *name, const char *ip, edict_t *pEntity)
|| SOURCE_ENGINE == SE_BMS \ || SOURCE_ENGINE == SE_BMS \
|| SOURCE_ENGINE == SE_INSURGENCY || SOURCE_ENGINE == SE_INSURGENCY
m_pIClient = engine->GetIServer()->GetClient(m_iIndex - 1); 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 #else
INetChannel *pNetChan = static_cast<INetChannel *>(engine->GetPlayerNetInfo(m_iIndex)); INetChannel *pNetChan = static_cast<INetChannel *>(engine->GetPlayerNetInfo(m_iIndex));
if (pNetChan) if (pNetChan)