mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-24 13:55:36 +03:00
Fixed default language errors
This commit is contained in:
parent
5469f70dba
commit
060a0a565c
@ -528,11 +528,13 @@ const char *CLangMngr::Format(const char *src, ...)
|
||||
if ((int)langName == -1)
|
||||
cpLangName = g_vault.get("server_language");
|
||||
else if ((int)langName >= 1 && (int)langName <= 32)
|
||||
cpLangName = ENTITY_KEYVALUE(GET_PLAYER_POINTER_I((int)langName)->pEdict, "_language");
|
||||
cpLangName = ENTITY_KEYVALUE(GET_PLAYER_POINTER_I((int)langName)->pEdict, "lang");
|
||||
else
|
||||
{
|
||||
cpLangName = langName;
|
||||
}
|
||||
if (!cpLangName || strlen(cpLangName) < 1)
|
||||
cpLangName = "en";
|
||||
char *key = va_arg(argptr, char*);
|
||||
const char *def = GetDef(cpLangName, key);
|
||||
while (*def)
|
||||
@ -558,7 +560,6 @@ const char *CLangMngr::Format(const char *src, ...)
|
||||
sprintf(outptr, "%f", tmpArg);
|
||||
outptr += strlen(outptr);
|
||||
break;
|
||||
break;
|
||||
}
|
||||
case INSERT_NEWLINE:
|
||||
*outptr++ = '\n';
|
||||
@ -648,12 +649,14 @@ char * CLangMngr::FormatAmxString(AMX *amx, cell *params, int parm, int &len)
|
||||
if (*pLangName == -1)
|
||||
cpLangName = g_vault.get("server_language");
|
||||
else if (*pLangName >= 1 && *pLangName <= 32)
|
||||
cpLangName = ENTITY_KEYVALUE(GET_PLAYER_POINTER_I(*pLangName)->pEdict, "_language");
|
||||
cpLangName = ENTITY_KEYVALUE(GET_PLAYER_POINTER_I(*pLangName)->pEdict, "lang");
|
||||
else
|
||||
{
|
||||
int len = 0;
|
||||
cpLangName = get_amxstring(amx, langName, 2, len);
|
||||
}
|
||||
if (!cpLangName || strlen(cpLangName) < 1)
|
||||
cpLangName = "en";
|
||||
int len;
|
||||
char *key = get_amxstring(amx, params[parm++], 1, len);
|
||||
const char *def = GetDef(cpLangName, key);
|
||||
|
@ -252,7 +252,11 @@ int C_Spawn( edict_t *pent ) {
|
||||
// ###### Load Vault
|
||||
g_vault.setSource( build_pathname("%s", get_localinfo("amxx_vault", "addons/amxx/configs/vault.ini")) );
|
||||
g_vault.loadVault( );
|
||||
|
||||
if (strlen(g_vault.get("server_language")) < 1)
|
||||
{
|
||||
g_vault.put("server_language", "en");
|
||||
g_vault.saveVault();
|
||||
}
|
||||
|
||||
// ###### Init time and freeze tasks
|
||||
g_game_timeleft = g_bmod_dod ? 1 : 0;
|
||||
|
Loading…
Reference in New Issue
Block a user