aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Globals/ObjectMgr.cpp
diff options
context:
space:
mode:
authorazazel <none@none>2010-09-16 13:14:14 +0600
committerazazel <none@none>2010-09-16 13:14:14 +0600
commit236356628ab04cd520e89551e95ac7583a9945bd (patch)
tree33400d7f4c9cbc01d6f7c9519d50489371a379fc /src/server/game/Globals/ObjectMgr.cpp
parent9739bea487bf9e5791379db51b56f58016fb2386 (diff)
Scripts/Quests:
* add support for quest 12634 Some Make Lemonade, Some Make Liquor (implement 51840 spell and Adventurous Dwarf AI, thanks akadabeer) * implement dummy effect for 49587 Seeds of Nature's Wrath spell (used in quest 12459 That Which Creates Can Also Destroy) * implement dummy effect for 19512 Apply Salve spell (used in quest 6124/6129 Curing the Sick) Scripts/Misc: some cleanup in chat log Core/Locales: fix issue when default locale for trinity_string strings was not used (thanks Aokromes for testing). --HG-- branch : trunk
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)