fix(Core/Creature): quest_greeting_locale (#19615)

* fix(Core/Creature): quest_greeting_locale

* closes https://github.com/azerothcore/azerothcore-wotlk/issues/14845
This commit is contained in:
Kitzunu
2024-08-13 21:09:36 +02:00
committed by GitHub
parent 7fbc655da6
commit 2e02c76399
6 changed files with 53 additions and 83 deletions

View File

@@ -599,20 +599,9 @@ struct QuestGreeting
{
uint16 EmoteType;
uint32 EmoteDelay;
std::string Text;
QuestGreeting() : EmoteType(0), EmoteDelay(0) { }
QuestGreeting(uint16 emoteType, uint32 emoteDelay, std::string text)
: EmoteType(emoteType), EmoteDelay(emoteDelay), Text(std::move(text)) { }
};
struct QuestGreetingLocale
{
std::vector<std::string> Greeting;
};
typedef std::unordered_map<uint32, QuestGreetingLocale> QuestGreetingLocaleContainer;
struct GossipMenuItems
{
uint32 MenuID;
@@ -672,7 +661,7 @@ struct QuestPOI
typedef std::vector<QuestPOI> QuestPOIVector;
typedef std::unordered_map<uint32, QuestPOIVector> QuestPOIContainer;
typedef std::array<std::unordered_map<uint32, QuestGreeting>, 2> QuestGreetingContainer;
typedef std::map<std::pair<uint32, uint8>, QuestGreeting> QuestGreetingContainer;
typedef std::unordered_map<uint32, VendorItemData> CacheVendorItemContainer;
typedef std::unordered_map<uint32, TrainerSpellData> CacheTrainerSpellContainer;
@@ -1275,26 +1264,6 @@ public:
if (itr == _pointOfInterestLocaleStore.end()) return nullptr;
return &itr->second;
}
[[nodiscard]] QuestGreetingLocale const* GetQuestGreetingLocale(TypeID type, uint32 id) const
{
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;
}
[[nodiscard]] QuestOfferRewardLocale const* GetQuestOfferRewardLocale(uint32 entry) const
{
auto itr = _questOfferRewardLocaleStore.find(entry);
@@ -1313,7 +1282,7 @@ public:
if (itr == _npcTextLocaleStore.end()) return nullptr;
return &itr->second;
}
QuestGreeting const* GetQuestGreeting(TypeID type, uint32 id) const;
[[nodiscard]] QuestGreeting const* GetQuestGreeting(TypeID type, uint32 id) const;
GameObjectData& NewGOData(ObjectGuid::LowType guid) { return _gameObjectDataStore[guid]; }
void DeleteGOData(ObjectGuid::LowType guid);
@@ -1621,7 +1590,6 @@ private:
AcoreStringContainer _acoreStringStore;
GossipMenuItemsLocaleContainer _gossipMenuItemsLocaleStore;
PointOfInterestLocaleContainer _pointOfInterestLocaleStore;
QuestGreetingLocaleContainer _questGreetingLocaleStore;
CacheVendorItemContainer _cacheVendorItemStore;
CacheTrainerSpellContainer _cacheTrainerSpellStore;