fix initial language selection

fix language selection bug

steps to reproduce:
- go to c:/users/username/otclient and remove settings file
- launch otclient
- select english
- restart otclient

expected behaviour: no more startup prompts for language selection when selecting default language
observed behaviour: everytime client gets restarted and you click the default language, it doesn't get saved if it didn't exist in config file previously
This commit is contained in:
Zbizu 2019-12-19 17:05:11 +01:00 committed by diath
parent be7a7d365f
commit fe6bbd6c21

View File

@ -144,7 +144,10 @@ end
function setLocale(name) function setLocale(name)
local locale = installedLocales[name] local locale = installedLocales[name]
if locale == currentLocale then return end if locale == currentLocale then
g_settings.set('locale', name)
return
end
if not locale then if not locale then
pwarning("Locale " .. name .. ' does not exist.') pwarning("Locale " .. name .. ' does not exist.')
return false return false