Code change for the acquisition of the locale

The original code was making use of a structure that is used for races
(Human, Orc, etc), which was rather an odd thing to do.

Seeing as the code would not work in this core, I took the opportunity
to rewrite it so that it checked that actual local file instead.
This commit is contained in:
Charles A Edwards 2016-08-03 16:31:45 +01:00 committed by Antz
parent 3a9b00aafd
commit 95f9c41ab0
3 changed files with 47 additions and 2 deletions

View file

@ -1529,6 +1529,23 @@ void World::SetInitialWorldSettings()
void World::DetectDBCLang()
{
// get the DBC Locale
int uLocale = ReadDBCLocale(m_dataPath);
if (!uLocale)
{
sLog.outError("Unable to determine your DBC Locale! (corrupt or missing component.wow-<locale>.txt file)");
Log::WaitBeforeContinueIfNeed();
exit(1);
}
m_defaultDbcLocale = LocaleConstant(uLocale);
sLog.outString("Using %s DBC Locale as default", localeNames[m_defaultDbcLocale]);
sLog.outString();
/* OLD VERSION - delete this code if the above proves to work as intended
uint32 m_lang_confid = sConfig.GetIntDefault("DBC.Locale", 255);
if (m_lang_confid != 255 && m_lang_confid >= MAX_LOCALE)
@ -1571,6 +1588,8 @@ void World::DetectDBCLang()
sLog.outString("Using %s DBC Locale as default. All available DBC locales: %s", localeNames[m_defaultDbcLocale], availableLocalsStr.empty() ? "<none>" : availableLocalsStr.c_str());
sLog.outString();
*/
}
/// Update the World !