From 3501e8fa46632e6a015af173c6de095315591f61 Mon Sep 17 00:00:00 2001 From: Vincent Herbet Date: Sat, 22 Mar 2014 15:23:55 +0100 Subject: [PATCH] Fix conflict with unicode string and bcompat translation layer (bug 5944, r=dvander) --- amxmodx/amxmod_compat.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/amxmodx/amxmod_compat.cpp b/amxmodx/amxmod_compat.cpp index 4ea29501..f409bc36 100644 --- a/amxmodx/amxmod_compat.cpp +++ b/amxmodx/amxmod_compat.cpp @@ -30,6 +30,14 @@ bool translate_bcompat(AMX *amx, cell *source, const char **_key, const char **_ return false; } + //not optimized but it works, eh + //if someone cares they can make a translate() wrapper that takes the key # in directly + const char *r_key = g_langMngr.GetKey(key); + if (!r_key) + { + return false; + } + cell amx_addr, *phys_addr; if (amx_Allot(amx, 3, &amx_addr, &phys_addr) != AMX_ERR_NONE) { @@ -50,9 +58,6 @@ bool translate_bcompat(AMX *amx, cell *source, const char **_key, const char **_ *phys_addr = LANG_SERVER; } - //not optimized but it works, eh - //if someone cares they can make a translate() wrapper that takes the key # in directly - const char *r_key = g_langMngr.GetKey(key); const char *def = translate(amx, amx_addr, r_key); if (!def) {