aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Globals/ObjectMgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Globals/ObjectMgr.cpp')
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 0c57e661bd3..0d314b39c6b 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -7800,12 +7800,10 @@ bool ObjectMgr::LoadTrinityStrings(char const* table, int32 min_value, int32 max
data.Content.resize(1);
++count;
- // 0 -> default, idx in to idx+1
- data.Content[0] = fields[1].GetCppString();
-
+ data.Default = fields[1].GetCppString();
for (uint8 i = 1; i < MAX_LOCALE; ++i)
{
- std::string str = fields[i+1].GetCppString();
+ std::string str = fields[i + 1].GetCppString();
AddLocaleString(str, LocaleConstant(i), data.Content);
}
} while (result->NextRow());
@@ -7821,15 +7819,11 @@ bool ObjectMgr::LoadTrinityStrings(char const* table, int32 min_value, int32 max
const char *ObjectMgr::GetTrinityString(int32 entry, int locale_idx) const
{
- // locale_idx == -1 -> default, locale_idx >= 0 in to idx+1
- // Content[0] always exist if exist TrinityStringLocale
if (TrinityStringLocale const *msl = GetTrinityStringLocale(entry))
{
- int idx = locale_idx + 1;
- if (int(msl->Content.size()) > idx && !msl->Content[idx].empty())
- return msl->Content[idx].c_str();
- else
- return msl->Content[0].c_str();
+ std::string s = msl->Default;
+ GetLocaleString(msl->Content, locale_idx, s);
+ return s.c_str();
}
if (entry > 0)