From ec11f8ad93afed0e7f3b124b700fce67ae7dad9b Mon Sep 17 00:00:00 2001 From: s1lent Date: Mon, 24 Jun 2019 00:44:41 +0700 Subject: [PATCH] Fixes #134 rh_get_mapname fixed incorrectly get length argument --- reapi/src/natives/natives_misc.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/reapi/src/natives/natives_misc.cpp b/reapi/src/natives/natives_misc.cpp index 58bad25..1c7a30c 100644 --- a/reapi/src/natives/natives_misc.cpp +++ b/reapi/src/natives/natives_misc.cpp @@ -2270,18 +2270,17 @@ enum MapNameType { MNT_TRUE, MNT_SET }; */ cell AMX_NATIVE_CALL rh_get_mapname(AMX *amx, cell *params) { - enum args_e { arg_count, arg_output, arg_len, arg_type }; + enum args_e { arg_count, arg_output, arg_maxlen, arg_type }; cell* dest = getAmxAddr(amx, params[arg_output]); - size_t length = *getAmxAddr(amx, params[arg_len]); switch ((MapNameType)params[arg_type]) { case MNT_TRUE: - setAmxString(dest, g_szMapName, length); + setAmxString(dest, g_szMapName, params[arg_maxlen]); break; case MNT_SET: - setAmxString(dest, g_RehldsData->GetName(), length); + setAmxString(dest, g_RehldsData->GetName(), params[arg_maxlen]); break; }