mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 21:26:23 +00:00
fix(Core/Creature): Nullcheck for questgreeting greeting (#19669)
* fix(Core/Creature): Nullcheck for questgreeting greeting * closes https://github.com/azerothcore/azerothcore-wotlk/issues/19659 * Update GossipDef.cpp
This commit is contained in:
@@ -319,10 +319,16 @@ void PlayerMenu::SendQuestGiverQuestList(QEmote const& eEmote, std::string const
|
||||
|
||||
if (QuestGreeting const* questGreeting = sObjectMgr->GetQuestGreeting(guid.GetTypeId(), guid.GetEntry()))
|
||||
{
|
||||
LocaleConstant locale = _session->GetSessionDbLocaleIndex();
|
||||
std::string strGreeting = questGreeting->Greeting[DEFAULT_LOCALE];
|
||||
if (questGreeting->Greeting.size() > size_t(locale) && !questGreeting->Greeting.empty())
|
||||
strGreeting = questGreeting->Greeting[locale];
|
||||
std::string strGreeting;
|
||||
// Check if greeting exists. Blizzlike that some creatures have empty greeting
|
||||
if (!questGreeting->Greeting.empty())
|
||||
{
|
||||
LocaleConstant locale = _session->GetSessionDbLocaleIndex();
|
||||
if (questGreeting->Greeting.size() > size_t(locale))
|
||||
strGreeting = questGreeting->Greeting[locale];
|
||||
else
|
||||
strGreeting = questGreeting->Greeting[DEFAULT_LOCALE];
|
||||
}
|
||||
|
||||
data << strGreeting;
|
||||
data << uint32(questGreeting->EmoteDelay);
|
||||
|
||||
Reference in New Issue
Block a user