diff --git a/reapi/src/hook_callback.h b/reapi/src/hook_callback.h index 88f0073..f868288 100644 --- a/reapi/src/hook_callback.h +++ b/reapi/src/hook_callback.h @@ -40,7 +40,7 @@ inline AType getApiType(int) { return ATYPE_INTEGER; } inline AType getApiType(unsigned) { return ATYPE_INTEGER; } inline AType getApiType(float) { return ATYPE_FLOAT; } inline AType getApiType(const char *) { return ATYPE_STRING; } -inline AType getApiType(char []) { return ATYPE_STRING; } +inline AType getApiType(char[]) { return ATYPE_STRING; } inline AType getApiType(CBaseEntity *) { return ATYPE_CLASSPTR; } inline AType getApiType(edict_t *) { return ATYPE_EDICT; } inline AType getApiType(entvars_t *) { return ATYPE_EVARS; } @@ -155,10 +155,11 @@ template void callVoidForward(size_t func, original_t original, f_args... args) { hookctx_t hookCtx(sizeof...(args), args...); + hookctx_t* save = g_hookCtx; g_hookCtx = &hookCtx; _callVoidForward(g_hookManager.getHookFast(func), original, args...); - g_hookCtx = nullptr; + g_hookCtx = save; } template @@ -179,7 +180,7 @@ NOINLINE R DLLEXPORT _callForward(const hook_t* hook, original_t original, volat } if (!hookCtx->retVal.set) { - g_amxxapi.LogError(fwd->GetAmx(), AMX_ERR_CALLBACK, "%s", "can't suppress original function call without new return value set"); + g_amxxapi.LogError(fwd->GetAmx(), AMX_ERR_CALLBACK, "can't suppress original function call without new return value set"); continue; } @@ -220,10 +221,11 @@ template R callForward(size_t func, original_t original, f_args... args) { hookctx_t hookCtx(sizeof...(args), args...); + hookctx_t* save = g_hookCtx; g_hookCtx = &hookCtx; auto ret = _callForward(g_hookManager.getHookFast(func), original, args...); - g_hookCtx = nullptr; + g_hookCtx = save; return ret; } diff --git a/reapi/src/natives/natives_misc.cpp b/reapi/src/natives/natives_misc.cpp index 0d5982f..587edfa 100644 --- a/reapi/src/natives/natives_misc.cpp +++ b/reapi/src/natives/natives_misc.cpp @@ -109,6 +109,8 @@ cell AMX_NATIVE_CALL rg_give_item(AMX *amx, cell *params) pPlayer->RemovePlayerItem(pItem); pItem->Kill(); break; + case GT_APPEND: break; + default: break; } pItem = pItem->m_pNext;