From 0f506f0dea41230a5957cf5f3ae3b08787e50633 Mon Sep 17 00:00:00 2001 From: ForesterDev <11771800+ForesterDev@users.noreply.github.com> Date: Sat, 4 Apr 2020 17:05:00 +0400 Subject: Core/Locales: Optimize locale loading - move the strings (#24385) * Core/Locales: Optimize locale loading - move the strings (cherry picked from commit 5dd686c080723eeeefdabb50b867f9f662d5deb9) Signed-off-by: ForesterDev # Conflicts: # src/server/game/Globals/ObjectMgr.cpp * Fix AchievementReward locales build Co-authored-by: Shauren --- src/server/game/Texts/CreatureTextMgr.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/server/game/Texts/CreatureTextMgr.cpp') diff --git a/src/server/game/Texts/CreatureTextMgr.cpp b/src/server/game/Texts/CreatureTextMgr.cpp index d587aaf2670..9d7efaa71ac 100644 --- a/src/server/game/Texts/CreatureTextMgr.cpp +++ b/src/server/game/Texts/CreatureTextMgr.cpp @@ -193,14 +193,13 @@ void CreatureTextMgr::LoadCreatureTextLocales() uint32 groupId = fields[1].GetUInt8(); uint32 id = fields[2].GetUInt8(); std::string localeName = fields[3].GetString(); - std::string text = fields[4].GetString(); - CreatureTextLocale& data = mLocaleTextMap[CreatureTextId(creatureId, groupId, id)]; LocaleConstant locale = GetLocaleByName(localeName); if (locale == LOCALE_enUS) continue; - ObjectMgr::AddLocaleString(text, locale, data.Text); + CreatureTextLocale& data = mLocaleTextMap[CreatureTextId(creatureId, groupId, id)]; + ObjectMgr::AddLocaleString(fields[4].GetString(), locale, data.Text); } while (result->NextRow()); TC_LOG_INFO("server.loading", ">> Loaded %u creature localized texts in %u ms", uint32(mLocaleTextMap.size()), GetMSTimeDiffToNow(oldMSTime)); -- cgit v1.2.3