Add new GiveNamedItem param for CS:GO.

This commit is contained in:
Nick Hastings 2018-12-06 20:18:21 -05:00
parent 0b35c84bf0
commit a01529b210

View File

@ -162,13 +162,14 @@ static cell_t GiveNamedItem(IPluginContext *pContext, const cell_t *params)
static ValveCall *pCall = NULL; static ValveCall *pCall = NULL;
if (!pCall) if (!pCall)
{ {
ValvePassInfo pass[5]; ValvePassInfo pass[6];
InitPass(pass[0], Valve_String, PassType_Basic, PASSFLAG_BYVAL); InitPass(pass[0], Valve_String, PassType_Basic, PASSFLAG_BYVAL);
InitPass(pass[1], Valve_POD, PassType_Basic, PASSFLAG_BYVAL); InitPass(pass[1], Valve_POD, PassType_Basic, PASSFLAG_BYVAL);
InitPass(pass[2], Valve_POD, PassType_Basic, PASSFLAG_BYVAL); InitPass(pass[2], Valve_POD, PassType_Basic, PASSFLAG_BYVAL);
InitPass(pass[3], Valve_Bool, PassType_Basic, PASSFLAG_BYVAL); InitPass(pass[3], Valve_Bool, PassType_Basic, PASSFLAG_BYVAL);
InitPass(pass[4], Valve_CBaseEntity, PassType_Basic, PASSFLAG_BYVAL); InitPass(pass[4], Valve_CBaseEntity, PassType_Basic, PASSFLAG_BYVAL);
if (!CreateBaseCall("GiveNamedItem", ValveCall_Player, &pass[4], pass, 4, &pCall)) InitPass(pass[5], Valve_POD, PassType_Basic, PASSFLAG_BYVAL);
if (!CreateBaseCall("GiveNamedItem", ValveCall_Player, &pass[5], pass, 5, &pCall))
{ {
return pContext->ThrowNativeError("\"GiveNamedItem\" not supported by this mod"); return pContext->ThrowNativeError("\"GiveNamedItem\" not supported by this mod");
} else if (!pCall) { } else if (!pCall) {
@ -183,6 +184,7 @@ static cell_t GiveNamedItem(IPluginContext *pContext, const cell_t *params)
DECODE_VALVE_PARAM(3, vparams, 1); DECODE_VALVE_PARAM(3, vparams, 1);
*(CEconItemView **)(vptr + 12) = NULL; *(CEconItemView **)(vptr + 12) = NULL;
*(bool *)(vptr + 16) = false; *(bool *)(vptr + 16) = false;
*(void **)(vptr + 20) = NULL;
FINISH_CALL_SIMPLE(&pEntity); FINISH_CALL_SIMPLE(&pEntity);
return gamehelpers->EntityToBCompatRef(pEntity); return gamehelpers->EntityToBCompatRef(pEntity);