fixed dbc local handling
This commit is contained in:
@@ -1752,20 +1752,20 @@ void World::SetInitialWorldSettings()
|
||||
|
||||
void World::DetectDBCLang()
|
||||
{
|
||||
uint8 m_lang_confid = ConfigMgr::GetIntDefault("DBC.Locale", 255);
|
||||
uint8 m_lang_confid = ConfigMgr::GetIntDefault("DBC.Locale", 0);
|
||||
|
||||
if (m_lang_confid != 255 && m_lang_confid >= TOTAL_LOCALES)
|
||||
if (m_lang_confid >= TOTAL_LOCALES)
|
||||
{
|
||||
sLog->outError("Incorrect DBC.Locale! Must be >= 0 and < %d (set to 0)", TOTAL_LOCALES);
|
||||
m_lang_confid = LOCALE_enUS;
|
||||
}
|
||||
|
||||
ChrRacesEntry const* race = sChrRacesStore.LookupEntry(1);
|
||||
/*ChrRacesEntry const* race = sChrRacesStore.LookupEntry(1);
|
||||
|
||||
std::string availableLocalsStr;
|
||||
|
||||
uint8 default_locale = TOTAL_LOCALES;
|
||||
/*for (uint8 i = default_locale-1; i < TOTAL_LOCALES; --i) // -1 will be 255 due to uint8
|
||||
for (uint8 i = default_locale-1; i < TOTAL_LOCALES; --i) // -1 will be 255 due to uint8
|
||||
{
|
||||
if (race->name[i][0] != '\0') // check by race names
|
||||
{
|
||||
@@ -1774,7 +1774,7 @@ void World::DetectDBCLang()
|
||||
availableLocalsStr += localeNames[i];
|
||||
availableLocalsStr += " ";
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
if (default_locale != m_lang_confid && m_lang_confid < TOTAL_LOCALES &&
|
||||
(m_availableDbcLocaleMask & (1 << m_lang_confid)))
|
||||
@@ -1785,12 +1785,12 @@ void World::DetectDBCLang()
|
||||
if (default_locale >= TOTAL_LOCALES)
|
||||
{
|
||||
sLog->outError("Unable to determine your DBC Locale! (corrupt DBC?)");
|
||||
//exit(1); TODO: enable after updated all dbc structures
|
||||
}
|
||||
exit(1);
|
||||
}*/
|
||||
|
||||
m_defaultDbcLocale = LocaleConstant(default_locale);
|
||||
m_defaultDbcLocale = LocaleConstant(m_lang_confid);
|
||||
|
||||
sLog->outString("Using %s DBC Locale as default. All available DBC locales: %s", localeNames[m_defaultDbcLocale], availableLocalsStr.empty() ? "<none>" : availableLocalsStr.c_str());
|
||||
sLog->outString("Using %s DBC Locale", localeNames[m_defaultDbcLocale]);
|
||||
sLog->outString();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user