fixed dbc local handling

This commit is contained in:
Rat
2011-11-23 13:17:40 +01:00
parent dd80a880dc
commit 8c4d145178
2 changed files with 11 additions and 12 deletions

View File

@@ -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();
}

View File

@@ -886,8 +886,7 @@ StrictPetNames = 0
#
# DBC.Locale
# Description: DBC language settings.
# Default: 255 - (Auto Detect)
# 0 - (English)
# Default: 0 - (English)
# 1 - (Korean)
# 2 - (French)
# 3 - (German)
@@ -897,7 +896,7 @@ StrictPetNames = 0
# 7 - (Spanish Mexico)
# 8 - (Russian)
DBC.Locale = 255
DBC.Locale = 0
#
# DeclinedNames