From a9ce39dee0057abeefc4584de1575d7b32957cc4 Mon Sep 17 00:00:00 2001 From: Vincent Herbet Date: Tue, 24 Jul 2018 10:37:05 +0200 Subject: [PATCH 1/5] Fix a buffer issue in server_changelevel forward caused by engine_changelevel native (#503) --- amxmodx/amxmodx.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/amxmodx/amxmodx.cpp b/amxmodx/amxmodx.cpp index 2cfeec5e..396d9237 100755 --- a/amxmodx/amxmodx.cpp +++ b/amxmodx/amxmodx.cpp @@ -2615,11 +2615,11 @@ static cell AMX_NATIVE_CALL change_task(AMX *amx, cell *params) static cell AMX_NATIVE_CALL engine_changelevel(AMX *amx, cell *params) { int length; - const char* new_map = get_amxstring(amx, params[1], 0, length); + ke::AString new_map(get_amxstring(amx, params[1], 0, length)); // Same as calling "changelevel" command but will trigger "server_changelevel" AMXX forward as well. // Filling second param will call "changelevel2" command, but this is not usable in multiplayer game. - g_pEngTable->pfnChangeLevel(new_map, NULL); + g_pEngTable->pfnChangeLevel(new_map.chars(), NULL); return 1; } From 7062d210a7a4dd7c7d3af13962437902bba94dc8 Mon Sep 17 00:00:00 2001 From: justgo97 Date: Tue, 24 Jul 2018 09:37:19 +0100 Subject: [PATCH 2/5] fix hlsdk_const.inc identation (#502) a copy past from reapi hlsdk_const.inc file --- plugins/include/hlsdk_const.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/include/hlsdk_const.inc b/plugins/include/hlsdk_const.inc index 316325e7..8c9d7525 100644 --- a/plugins/include/hlsdk_const.inc +++ b/plugins/include/hlsdk_const.inc @@ -625,7 +625,7 @@ #define TRAIN_MEDIUM 0x03 #define TRAIN_FAST 0x04 #define TRAIN_BACK 0x05 - + /** * Valve Mod Weapon Constants */ @@ -660,7 +660,7 @@ #define ITEM_FLAG_NOAUTORELOAD (1<<1) #define ITEM_FLAG_NOAUTOSWITCHEMPTY (1<<2) #define ITEM_FLAG_LIMITINWORLD (1<<3) -#define ITEM_FLAG_EXHAUSTIBLE (1<<4) +#define ITEM_FLAG_EXHAUSTIBLE (1<<4) #define FEV_NOTHOST (1<<0) // Skip local host for event send. From 57abc4a1c549c729964d73a4e0762f0fccfe785a Mon Sep 17 00:00:00 2001 From: Vincent Herbet Date: Tue, 24 Jul 2018 10:37:56 +0200 Subject: [PATCH 3/5] Fix a compilation regression in LookupLangKey (introduced with #222) (#499) --- plugins/include/lang.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/include/lang.inc b/plugins/include/lang.inc index 247a6004..a88c66c4 100755 --- a/plugins/include/lang.inc +++ b/plugins/include/lang.inc @@ -103,7 +103,7 @@ native AddTranslation(const lang[3], TransKey:key, const phrase[]); * * @return 1 on success, 0 otherwise */ -native LookupLangKey(Output[], OutputSize, const Key[], &id); +native LookupLangKey(Output[], OutputSize, const Key[], const &id); /** * Sets the global language target. From 4ae31f6f263e02e7f7b326884b4077fdcf7d8219 Mon Sep 17 00:00:00 2001 From: OciXCrom Date: Tue, 24 Jul 2018 15:36:31 +0200 Subject: [PATCH 4/5] nvault.inc documentation fix (#501) * Update lang.inc * Update lang.inc * Update nvault.inc * Update nvault.inc --- plugins/include/nvault.inc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/include/nvault.inc b/plugins/include/nvault.inc index 85cadc48..4c025c1a 100755 --- a/plugins/include/nvault.inc +++ b/plugins/include/nvault.inc @@ -37,7 +37,7 @@ native nvault_open(const name[]); /** - * Retrieves a value from the given key + * Retrieves a value from the given key. * * @note An example of retrieving a string: * nvault_get(vaultHandle, "myKey", myString, charsmax(myString)); @@ -50,13 +50,16 @@ native nvault_open(const name[]); * vault and copies it to the third argument, up to * 4th argument characters. * - * @noreturn + * @return Result as integer if only the first two arguments + * of the function are used. + * 1 if only the first three arguments are used. + * String length if all four parameters are used. * @error On invalid vault handle. */ native nvault_get(vault, const key[], any:...); /** - * Retrieves full information about a vault entry + * Retrieves full information about a vault entry. * * @param vault A vault handle returned from nvault_open() * @param key A key to get information from @@ -109,7 +112,7 @@ native nvault_pset(vault, const key[], const value[]); * @param start The timestamp to start erasing from * @param end The timestamp to erase to * - * @noreturn + * @return Number of erased values. * @error On invalid vault handle. */ native nvault_prune(vault, start, end); From 9700caefaeda5dae3d2cc6b19e756cd8fc2f4884 Mon Sep 17 00:00:00 2001 From: Vincent Herbet Date: Tue, 24 Jul 2018 15:45:50 +0200 Subject: [PATCH 5/5] Fix client_print_color where the color is ignored if string starts with an unicode character (#504) --- amxmodx/amxmodx.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/amxmodx/amxmodx.cpp b/amxmodx/amxmodx.cpp index 396d9237..33b010d5 100755 --- a/amxmodx/amxmodx.cpp +++ b/amxmodx/amxmodx.cpp @@ -338,7 +338,7 @@ static cell AMX_NATIVE_CALL client_print_color(AMX *amx, cell *params) /* 3 para g_langMngr.SetDefLang(i); msg = format_amxstring(amx, params, 3, len); - if (*msg > 4) // Insert default color code at the start if not present, otherwise message will not be colored. + if (static_cast(*msg) > 4) // Insert default color code at the start if not present, otherwise message will not be colored. { memmove(msg + 1, msg, ke::Min(len++, 191)); *msg = 1; @@ -376,7 +376,7 @@ static cell AMX_NATIVE_CALL client_print_color(AMX *amx, cell *params) /* 3 para msg = format_amxstring(amx, params, 3, len); - if (*msg > 4) // Insert default color code at the start if not present, otherwise message will not be colored. + if (static_cast(*msg) > 4) // Insert default color code at the start if not present, otherwise message will not be colored. { memmove(msg + 1, msg, ke::Min(len++, 191)); *msg = 1;