Exposed SDKCall_Engine call type to use CVEngineServer methods (#1648)

* Update vdecoder.h

* Update vcaller.cpp

* Update sdktools.inc
This commit is contained in:
Accelerator 2022-07-26 23:14:49 +03:00 committed by GitHub
parent 5f7b22d2a4
commit e5ebd65176
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 10 deletions

View File

@ -336,15 +336,25 @@ static cell_t SDKCall(IPluginContext *pContext, const cell_t *params)
}
break;
case ValveCall_Server:
{
if (iserver == NULL)
{
vc->stk_put(ptr);
return pContext->ThrowNativeError("Server unsupported or not available; file a bug report");
}
*(void **)ptr = iserver;
}
break;
{
if (iserver == NULL)
{
vc->stk_put(ptr);
return pContext->ThrowNativeError("Server unsupported or not available; file a bug report");
}
*(void **)ptr = iserver;
}
break;
case ValveCall_Engine:
{
if (engine == NULL)
{
vc->stk_put(ptr);
return pContext->ThrowNativeError("Engine unsupported or not available; file a bug report");
}
*(void **)ptr = engine;
}
break;
case ValveCall_GameRules:
{
void *pGameRules = GameRules();

View File

@ -83,6 +83,7 @@ enum ValveCallType
ValveCall_EntityList, /**< Thiscall (CGlobalEntityList implicit first paramater) */
ValveCall_Raw, /**< Thiscall (address explicit first parameter) */
ValveCall_Server, /**< Thiscall (CBaseServer implicit first parameter) */
ValveCall_Engine, /**< Thiscall (CVEngineServer implicit first parameter) */
};
/**

View File

@ -61,7 +61,8 @@ enum SDKCallType
SDKCall_GameRules, /**< CGameRules call */
SDKCall_EntityList, /**< CGlobalEntityList call */
SDKCall_Raw, /**< |this| pointer with an arbitrary address */
SDKCall_Server /**< CBaseServer call */
SDKCall_Server, /**< CBaseServer call */
SDKCall_Engine /**< CVEngineServer call */
};
enum SDKLibrary