mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Fix language file being loaded twice when starting
Ignore language file config variable being set initially in the conchain (i.e. when `GlobalTime` still returns zero) and check whether the value changed before reloading the language.
This commit is contained in:
parent
64fec2cd37
commit
f762e2364f
|
@ -2414,9 +2414,13 @@ void CGameClient::ConKill(IConsole::IResult *pResult, void *pUserData)
|
|||
|
||||
void CGameClient::ConchainLanguageUpdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData)
|
||||
{
|
||||
CGameClient *pThis = static_cast<CGameClient *>(pUserData);
|
||||
const bool Changed = pThis->Client()->GlobalTime() && pResult->NumArguments() && str_comp(pResult->GetString(0), g_Config.m_ClLanguagefile) != 0;
|
||||
pfnCallback(pResult, pCallbackUserData);
|
||||
if(pResult->NumArguments())
|
||||
((CGameClient *)pUserData)->OnLanguageChange();
|
||||
if(Changed)
|
||||
{
|
||||
pThis->OnLanguageChange();
|
||||
}
|
||||
}
|
||||
|
||||
void CGameClient::ConchainSpecialInfoupdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData)
|
||||
|
|
Loading…
Reference in a new issue