From 53c029471f382875ca90ee84c995545676e4ad34 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 6 Feb 2006 13:10:23 +0000 Subject: [PATCH] removed usage of CVAR_GET_STRING --- amxmodx/CLang.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/amxmodx/CLang.cpp b/amxmodx/CLang.cpp index b7757104..dbc1a2f3 100755 --- a/amxmodx/CLang.cpp +++ b/amxmodx/CLang.cpp @@ -303,7 +303,7 @@ bool CLangMngr::CLang::Load(FILE *fp) /******** CLangMngr *********/ -String &make_string(const char *str) +inline String &make_string(const char *str) { static String g_temp; @@ -370,6 +370,8 @@ int CLangMngr::GetKeyEntry(String &key) size_t do_amx_format(AMX *amx, cell *params, int *param, const char **lex, char *output, size_t maxlen, int level); THash BadLang_Table; +static cvar_t *amx_mldebug = NULL; + size_t do_amx_format_parameter(AMX *amx, cell *params, const char **fmtstr, int *param, char *output, size_t maxlen, int level) { static char buffer[MAX_LEVELS][2048]; @@ -473,13 +475,16 @@ size_t do_amx_format_parameter(AMX *amx, cell *params, const char **fmtstr, int key = get_amxstring(amx, _addr, 1, tmpLen); def = g_langMngr.GetDef(pLangName, key, status); - bool debug = (strcmp(CVAR_GET_STRING("amx_mldebug"), "")) ? true : false; + if (!amx_mldebug) + amx_mldebug = CVAR_GET_POINTER("amx_mldebug"); + + bool debug = (amx_mldebug && amx_mldebug->string && (amx_mldebug->string[0] != '\0')); if (debug) { int debug_status; bool validlang = true; - const char *testlang = CVAR_GET_STRING("amx_mldebug"); + const char *testlang = amx_mldebug->string; if (!g_langMngr.LangExists(testlang)) {