diff --git a/src/server/game/DataStores/DB2Stores.cpp b/src/server/game/DataStores/DB2Stores.cpp index 91c57a3bc34..8fa9e0bb8aa 100644 --- a/src/server/game/DataStores/DB2Stores.cpp +++ b/src/server/game/DataStores/DB2Stores.cpp @@ -63,7 +63,7 @@ inline void LoadDB2(uint32& availableDb2Locales, DB2StoreProblemList& errlist, D for (uint32 i = 0; i < TOTAL_LOCALES; ++i) { - if (defaultLocale == i) + if (defaultLocale == i || i == LOCALE_NONE) continue; if (availableDb2Locales & (1 << i)) @@ -92,7 +92,7 @@ inline void LoadDB2(uint32& availableDb2Locales, DB2StoreProblemList& errlist, D stores[storage->GetHash()] = storage; } -void DB2Manager::LoadStores(std::string const& dataPath, uint32 defaultLocale) +uint32 DB2Manager::LoadStores(std::string const& dataPath, uint32 defaultLocale) { uint32 oldMSTime = getMSTime(); @@ -132,6 +132,8 @@ void DB2Manager::LoadStores(std::string const& dataPath, uint32 defaultLocale) } TC_LOG_INFO("server.loading", ">> Initialized %d DB2 data stores in %u ms", DB2FilesCount, GetMSTimeDiffToNow(oldMSTime)); + + return availableDb2Locales; } DB2StorageBase const* DB2Manager::GetStorage(uint32 type) const diff --git a/src/server/game/DataStores/DB2Stores.h b/src/server/game/DataStores/DB2Stores.h index ed8807e6d9f..1223af1cfd6 100644 --- a/src/server/game/DataStores/DB2Stores.h +++ b/src/server/game/DataStores/DB2Stores.h @@ -46,7 +46,7 @@ public: static DB2Manager& Instance(); - void LoadStores(std::string const& dataPath, uint32 defaultLocale); + uint32 LoadStores(std::string const& dataPath, uint32 defaultLocale); DB2StorageBase const* GetStorage(uint32 type) const; void LoadHotfixData(); diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 826fd5b3fee..d2a92e00598 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1656,7 +1656,12 @@ void World::SetInitialWorldSettings() ///- Load the DBC/DB2 files TC_LOG_INFO("server.loading", "Initialize data stores..."); sDBCManager.LoadStores(m_dataPath, m_defaultDbcLocale); - sDB2Manager.LoadStores(m_dataPath, m_defaultDbcLocale); + m_availableDbcLocaleMask = sDB2Manager.LoadStores(m_dataPath, m_defaultDbcLocale); + if (!(m_availableDbcLocaleMask & (1 << m_defaultDbcLocale))) + { + TC_LOG_FATAL("server.loading", "Unable to load db2/dbc files for %s locale specified in DBC.Locale config!", localeNames[m_defaultDbcLocale]); + exit(1); + } TC_LOG_INFO("misc", "Loading hotfix info..."); sDB2Manager.LoadHotfixData();