fixed dbc local handling
This commit is contained in:
@@ -1752,20 +1752,20 @@ void World::SetInitialWorldSettings()
|
|||||||
|
|
||||||
void World::DetectDBCLang()
|
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);
|
sLog->outError("Incorrect DBC.Locale! Must be >= 0 and < %d (set to 0)", TOTAL_LOCALES);
|
||||||
m_lang_confid = LOCALE_enUS;
|
m_lang_confid = LOCALE_enUS;
|
||||||
}
|
}
|
||||||
|
|
||||||
ChrRacesEntry const* race = sChrRacesStore.LookupEntry(1);
|
/*ChrRacesEntry const* race = sChrRacesStore.LookupEntry(1);
|
||||||
|
|
||||||
std::string availableLocalsStr;
|
std::string availableLocalsStr;
|
||||||
|
|
||||||
uint8 default_locale = TOTAL_LOCALES;
|
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
|
if (race->name[i][0] != '\0') // check by race names
|
||||||
{
|
{
|
||||||
@@ -1774,7 +1774,7 @@ void World::DetectDBCLang()
|
|||||||
availableLocalsStr += localeNames[i];
|
availableLocalsStr += localeNames[i];
|
||||||
availableLocalsStr += " ";
|
availableLocalsStr += " ";
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
|
||||||
if (default_locale != m_lang_confid && m_lang_confid < TOTAL_LOCALES &&
|
if (default_locale != m_lang_confid && m_lang_confid < TOTAL_LOCALES &&
|
||||||
(m_availableDbcLocaleMask & (1 << m_lang_confid)))
|
(m_availableDbcLocaleMask & (1 << m_lang_confid)))
|
||||||
@@ -1785,12 +1785,12 @@ void World::DetectDBCLang()
|
|||||||
if (default_locale >= TOTAL_LOCALES)
|
if (default_locale >= TOTAL_LOCALES)
|
||||||
{
|
{
|
||||||
sLog->outError("Unable to determine your DBC Locale! (corrupt DBC?)");
|
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();
|
sLog->outString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -886,8 +886,7 @@ StrictPetNames = 0
|
|||||||
#
|
#
|
||||||
# DBC.Locale
|
# DBC.Locale
|
||||||
# Description: DBC language settings.
|
# Description: DBC language settings.
|
||||||
# Default: 255 - (Auto Detect)
|
# Default: 0 - (English)
|
||||||
# 0 - (English)
|
|
||||||
# 1 - (Korean)
|
# 1 - (Korean)
|
||||||
# 2 - (French)
|
# 2 - (French)
|
||||||
# 3 - (German)
|
# 3 - (German)
|
||||||
@@ -897,7 +896,7 @@ StrictPetNames = 0
|
|||||||
# 7 - (Spanish Mexico)
|
# 7 - (Spanish Mexico)
|
||||||
# 8 - (Russian)
|
# 8 - (Russian)
|
||||||
|
|
||||||
DBC.Locale = 255
|
DBC.Locale = 0
|
||||||
|
|
||||||
#
|
#
|
||||||
# DeclinedNames
|
# DeclinedNames
|
||||||
|
|||||||
Reference in New Issue
Block a user