diff options
Diffstat (limited to 'src/server/game/Globals/ObjectMgr.cpp')
-rw-r--r-- | src/server/game/Globals/ObjectMgr.cpp | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 020028e6274..283323b65f3 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -291,8 +291,8 @@ void ObjectMgr::LoadCreatureLocales() _creatureLocaleStore.clear(); // need for reload case - QueryResult result = WorldDatabase.Query("SELECT entry, name_loc1, subname_loc1, name_loc2, subname_loc2, name_loc3, subname_loc3, name_loc4, subname_loc4, name_loc5, subname_loc5, name_loc6, subname_loc6, name_loc7, subname_loc7, name_loc8, subname_loc8 FROM locales_creature"); - + // 0 1 2 3 + QueryResult result = WorldDatabase.Query("SELECT entry, locale, Name, Title FROM creature_template_locale"); if (!result) return; @@ -300,16 +300,20 @@ void ObjectMgr::LoadCreatureLocales() { Field* fields = result->Fetch(); - uint32 entry = fields[0].GetUInt32(); + uint32 id = fields[0].GetUInt32(); + std::string localeName = fields[1].GetString(); - CreatureLocale& data = _creatureLocaleStore[entry]; + std::string name = fields[2].GetString(); + std::string title = fields[3].GetString(); + + CreatureLocale& data = _creatureLocaleStore[id]; + LocaleConstant locale = GetLocaleByName(localeName); + if (locale == LOCALE_enUS) + continue; + + AddLocaleString(name, locale, data.Name); + AddLocaleString(title, locale, data.Title); - for (uint8 i = TOTAL_LOCALES - 1; i > 0; --i) - { - LocaleConstant locale = (LocaleConstant) i; - AddLocaleString(fields[1 + 2 * (i - 1)].GetString(), locale, data.Name); - AddLocaleString(fields[1 + 2 * (i - 1) + 1].GetString(), locale, data.SubName); - } } while (result->NextRow()); TC_LOG_INFO("server.loading", ">> Loaded %u creature locale strings in %u ms", uint32(_creatureLocaleStore.size()), GetMSTimeDiffToNow(oldMSTime)); @@ -442,7 +446,7 @@ void ObjectMgr::LoadCreatureTemplate(Field* fields) creatureTemplate.Modelid3 = fields[8].GetUInt32(); creatureTemplate.Modelid4 = fields[9].GetUInt32(); creatureTemplate.Name = fields[10].GetString(); - creatureTemplate.SubName = fields[11].GetString(); + creatureTemplate.Title = fields[11].GetString(); creatureTemplate.IconName = fields[12].GetString(); creatureTemplate.GossipMenuId = fields[13].GetUInt32(); creatureTemplate.minlevel = fields[14].GetUInt8(); @@ -6520,6 +6524,8 @@ void ObjectMgr::LoadGameObjectLocales() GameObjectLocale& data = _gameObjectLocaleStore[id]; LocaleConstant locale = GetLocaleByName(localeName); + if (locale == LOCALE_enUS) + continue; AddLocaleString(name, locale, data.Name); AddLocaleString(castBarCaption, locale, data.CastBarCaption); |