diff --git a/amxmodx/CLang.cpp b/amxmodx/CLang.cpp index ce01fee6..9a1dd1f9 100755 --- a/amxmodx/CLang.cpp +++ b/amxmodx/CLang.cpp @@ -522,19 +522,11 @@ char * CLangMngr::FormatAmxString(AMX *amx, cell *params, int parm, int &len) char *outptr = outbuf; cell *src = get_amxaddr(amx, params[parm++]); - enum State - { - S_Normal, - S_PercentSign, - }; - - State curState = S_Normal; while (*src) { - if (*src == '%' && curState == S_Normal) - curState = S_PercentSign; - else if (curState == S_PercentSign) + if (*src == '%') { + ++src; if (*src=='L') { cell langName = params[parm]; // "en" case (langName contains the address to the string) @@ -592,7 +584,7 @@ char * CLangMngr::FormatAmxString(AMX *amx, cell *params, int parm, int &len) if (*def == '%') { ++def; - char format[32]; + static char format[32]; format[0] = '%'; char *ptr = format+1; while (ptr-formatGetDllFuncTable().pfnSpawn = NULL; RETURN_META_VALUE(MRES_IGNORED, 0); } @@ -440,7 +439,9 @@ void C_ServerDeactivate() { // However leave AMX modules which are loaded only once void C_ServerDeactivate_Post() { - g_initialized = false; + // HACKHACK: + // Make sure the spawn function will be called again + g_FakeMeta.m_Plugins.begin()->GetDllFuncTable().pfnSpawn = C_Spawn; detachReloadModules();