From 5dcd01801c98c0bab9c641c81e76ee0ecabe7b06 Mon Sep 17 00:00:00 2001 From: Nick Hastings Date: Thu, 6 Dec 2018 20:18:21 -0500 Subject: [PATCH] Add new GiveNamedItem param for CS:GO. --- extensions/sdktools/vnatives.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/extensions/sdktools/vnatives.cpp b/extensions/sdktools/vnatives.cpp index 92694e22..de0544a9 100644 --- a/extensions/sdktools/vnatives.cpp +++ b/extensions/sdktools/vnatives.cpp @@ -161,13 +161,14 @@ static cell_t GiveNamedItem(IPluginContext *pContext, const cell_t *params) static ValveCall *pCall = NULL; if (!pCall) { - ValvePassInfo pass[5]; + ValvePassInfo pass[6]; InitPass(pass[0], Valve_String, PassType_Basic, PASSFLAG_BYVAL); InitPass(pass[1], 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[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"); } else if (!pCall) { @@ -182,6 +183,7 @@ static cell_t GiveNamedItem(IPluginContext *pContext, const cell_t *params) DECODE_VALVE_PARAM(3, vparams, 1); *(CEconItemView **)(vptr + 12) = NULL; *(bool *)(vptr + 16) = false; + *(void **)(vptr + 20) = NULL; FINISH_CALL_SIMPLE(&pEntity); return gamehelpers->EntityToBCompatRef(pEntity);