Exposed SDKCall_Server call type to use CBaseServer methods

This commit is contained in:
dragokas 2021-10-26 23:07:37 +03:00 committed by Your Name
parent 3171d4fb7b
commit 0449342bb0
3 changed files with 12 additions and 0 deletions

View File

@ -335,6 +335,16 @@ static cell_t SDKCall(IPluginContext *pContext, const cell_t *params)
startparam++;
}
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;
case ValveCall_GameRules:
{
void *pGameRules = GameRules();

View File

@ -79,6 +79,7 @@ enum ValveCallType
ValveCall_Static, /**< Static call */
ValveCall_Entity, /**< Thiscall (CBaseEntity implicit first parameter) */
ValveCall_Player, /**< Thiscall (CBasePlayer implicit first parameter) */
ValveCall_Server, /**< Thiscall (CBaseServer implicit first parameter) */
ValveCall_GameRules, /**< Thiscall (CGameRules implicit first paramater) */
ValveCall_EntityList, /**< Thiscall (CGlobalEntityList implicit first paramater) */
ValveCall_Raw, /**< Thiscall (address explicit first parameter) */

View File

@ -58,6 +58,7 @@ enum SDKCallType
SDKCall_Static, /**< Static call */
SDKCall_Entity, /**< CBaseEntity call */
SDKCall_Player, /**< CBasePlayer call */
SDKCall_Server, /**< CBaseServer call */
SDKCall_GameRules, /**< CGameRules call */
SDKCall_EntityList, /**< CGlobalEntityList call */
SDKCall_Raw /**< |this| pointer with an arbitrary address */