fix(Core/Gossip): quest_greeting_locale doesn't work #10913 (#14532)

* fix issue #10913

fix GetQuestGreetingLocale typeIndex just like GetQuestGreeting

* Update ObjectMgr.h

* fix Core/Gossip: gossipMenuLocale doesn't work

* Revert "fix Core/Gossip: gossipMenuLocale doesn't work"

This reverts commit f59f07d1504f21cf2ae1eaa37aa088100c352e3b.
This commit is contained in:
Alvin Zhu
2023-01-08 03:21:47 +08:00
committed by GitHub
parent de92ae1d31
commit e322c017ea

View File

@@ -1263,7 +1263,21 @@ public:
}
[[nodiscard]] QuestGreetingLocale const* GetQuestGreetingLocale(TypeID type, uint32 id) const
{
QuestGreetingLocaleContainer::const_iterator itr = _questGreetingLocaleStore.find(MAKE_PAIR32(type, id));
uint32 typeIndex;
if (type == TYPEID_UNIT)
{
typeIndex = 0;
}
else if (type == TYPEID_GAMEOBJECT)
{
typeIndex = 1;
}
else
{
return nullptr;
}
QuestGreetingLocaleContainer::const_iterator itr = _questGreetingLocaleStore.find(MAKE_PAIR32(typeIndex, id));
if (itr == _questGreetingLocaleStore.end()) return nullptr;
return &itr->second;
}