From 7b4d68ae27ebe5e2de26e10a4af9c21a58df88bd Mon Sep 17 00:00:00 2001 From: s1lentq Date: Fri, 1 Jan 2021 20:15:20 +0700 Subject: [PATCH] Fixed get_ucmd, get_pmtrace natives. Closes #182 --- .../extra/amxmodx/scripting/include/reapi_engine.inc | 2 +- reapi/src/natives/natives_members.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/reapi/extra/amxmodx/scripting/include/reapi_engine.inc b/reapi/extra/amxmodx/scripting/include/reapi_engine.inc index d18df47..8b797c3 100644 --- a/reapi/extra/amxmodx/scripting/include/reapi_engine.inc +++ b/reapi/extra/amxmodx/scripting/include/reapi_engine.inc @@ -25,7 +25,7 @@ native any:get_entvar(const index, const EntVars:var, any:...); native set_ucmd(const ucmd, const UCmd:var, any:...); /* -* Returns entvar data from an entity. +* Returns usercmd data from an entity. * Use the ucmd_* UCmd enum */ native any:get_ucmd(const ucmd, const UCmd:var, any:...); diff --git a/reapi/src/natives/natives_members.cpp b/reapi/src/natives/natives_members.cpp index b04562f..b9c2324 100644 --- a/reapi/src/natives/natives_members.cpp +++ b/reapi/src/natives/natives_members.cpp @@ -577,14 +577,14 @@ cell AMX_NATIVE_CALL set_ucmd(AMX *amx, cell *params) } /* -* Returns entvar data from an entity. +* Returns usercmd data from an entity. * Use the ucmd_* UCmd enum * * native any:get_ucmd(const ucmd, const UCmd:var, any:...); */ cell AMX_NATIVE_CALL get_ucmd(AMX *amx, cell *params) { - enum args_e { arg_count, arg_cmd, arg_var, arg_3, arg_4 }; + enum args_e { arg_count, arg_cmd, arg_var, arg_3 }; member_t *member = memberlist[params[arg_var]]; if (unlikely(member == nullptr)) { @@ -597,10 +597,10 @@ cell AMX_NATIVE_CALL get_ucmd(AMX *amx, cell *params) if (PARAMS_COUNT == 3) { dest = getAmxAddr(amx, params[arg_3]); - element = *getAmxAddr(amx, params[arg_4]); + element = 0; } else { - dest = (member->type != MEMBER_FLOAT) ? nullptr : getAmxAddr(amx, params[arg_3]); + dest = nullptr; element = 0; } @@ -643,7 +643,7 @@ cell AMX_NATIVE_CALL set_pmtrace(AMX *amx, cell *params) */ cell AMX_NATIVE_CALL get_pmtrace(AMX *amx, cell *params) { - enum args_e { arg_count, arg_tr, arg_var, arg_3, arg_4 }; + enum args_e { arg_count, arg_tr, arg_var, arg_3 }; member_t *member = memberlist[params[arg_var]]; if (unlikely(member == nullptr)) { @@ -656,7 +656,7 @@ cell AMX_NATIVE_CALL get_pmtrace(AMX *amx, cell *params) if (PARAMS_COUNT == 3) { dest = getAmxAddr(amx, params[arg_3]); - element = *getAmxAddr(amx, params[arg_4]); + element = 0; } else { dest = nullptr;