mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-25 14:25:38 +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)
|
if ((int)langName == -1)
|
||||||
cpLangName = g_vault.get("server_language");
|
cpLangName = g_vault.get("server_language");
|
||||||
else if ((int)langName >= 1 && (int)langName <= 32)
|
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
|
else
|
||||||
{
|
{
|
||||||
cpLangName = langName;
|
cpLangName = langName;
|
||||||
}
|
}
|
||||||
|
if (!cpLangName || strlen(cpLangName) < 1)
|
||||||
|
cpLangName = "en";
|
||||||
char *key = va_arg(argptr, char*);
|
char *key = va_arg(argptr, char*);
|
||||||
const char *def = GetDef(cpLangName, key);
|
const char *def = GetDef(cpLangName, key);
|
||||||
while (*def)
|
while (*def)
|
||||||
@ -558,7 +560,6 @@ const char *CLangMngr::Format(const char *src, ...)
|
|||||||
sprintf(outptr, "%f", tmpArg);
|
sprintf(outptr, "%f", tmpArg);
|
||||||
outptr += strlen(outptr);
|
outptr += strlen(outptr);
|
||||||
break;
|
break;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
case INSERT_NEWLINE:
|
case INSERT_NEWLINE:
|
||||||
*outptr++ = '\n';
|
*outptr++ = '\n';
|
||||||
@ -648,12 +649,14 @@ char * CLangMngr::FormatAmxString(AMX *amx, cell *params, int parm, int &len)
|
|||||||
if (*pLangName == -1)
|
if (*pLangName == -1)
|
||||||
cpLangName = g_vault.get("server_language");
|
cpLangName = g_vault.get("server_language");
|
||||||
else if (*pLangName >= 1 && *pLangName <= 32)
|
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
|
else
|
||||||
{
|
{
|
||||||
int len = 0;
|
int len = 0;
|
||||||
cpLangName = get_amxstring(amx, langName, 2, len);
|
cpLangName = get_amxstring(amx, langName, 2, len);
|
||||||
}
|
}
|
||||||
|
if (!cpLangName || strlen(cpLangName) < 1)
|
||||||
|
cpLangName = "en";
|
||||||
int len;
|
int len;
|
||||||
char *key = get_amxstring(amx, params[parm++], 1, len);
|
char *key = get_amxstring(amx, params[parm++], 1, len);
|
||||||
const char *def = GetDef(cpLangName, key);
|
const char *def = GetDef(cpLangName, key);
|
||||||
|
@ -252,7 +252,11 @@ int C_Spawn( edict_t *pent ) {
|
|||||||
// ###### Load Vault
|
// ###### Load Vault
|
||||||
g_vault.setSource( build_pathname("%s", get_localinfo("amxx_vault", "addons/amxx/configs/vault.ini")) );
|
g_vault.setSource( build_pathname("%s", get_localinfo("amxx_vault", "addons/amxx/configs/vault.ini")) );
|
||||||
g_vault.loadVault( );
|
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
|
// ###### Init time and freeze tasks
|
||||||
g_game_timeleft = g_bmod_dod ? 1 : 0;
|
g_game_timeleft = g_bmod_dod ? 1 : 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user