diff --git a/extensions/sdktools/vnatives.cpp b/extensions/sdktools/vnatives.cpp index 711360df..f47cb3a7 100644 --- a/extensions/sdktools/vnatives.cpp +++ b/extensions/sdktools/vnatives.cpp @@ -39,6 +39,7 @@ #include "CellRecipientFilter.h" #include #include +#include "iserver.h" SourceHook::List g_RegCalls; SourceHook::List g_CallWraps; @@ -921,7 +922,8 @@ static cell_t ActivateEntity(IPluginContext *pContext, const cell_t *params) static cell_t SetClientInfo(IPluginContext *pContext, const cell_t *params) { IGamePlayer *player = playerhelpers->GetGamePlayer(params[1]); - if (player == NULL) + IClient *pClient = iserver->GetClient(params[1]); + if (player == NULL || pClient == NULL) { return pContext->ThrowNativeError("Invalid client index %d", params[1]); } @@ -957,9 +959,6 @@ static cell_t SetClientInfo(IPluginContext *pContext, const cell_t *params) } } - INetChannel *pNetChan = static_cast(engine->GetPlayerNetInfo(params[1])); - IClient *pClient = static_cast(pNetChan->GetMsgHandler()); - unsigned char *CGameClient = (unsigned char *)pClient - 4; START_CALL();