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()))
|
if (QuestGreeting const* questGreeting = sObjectMgr->GetQuestGreeting(guid.GetTypeId(), guid.GetEntry()))
|
||||||
{
|
{
|
||||||
LocaleConstant locale = _session->GetSessionDbLocaleIndex();
|
std::string strGreeting;
|
||||||
std::string strGreeting = questGreeting->Greeting[DEFAULT_LOCALE];
|
// Check if greeting exists. Blizzlike that some creatures have empty greeting
|
||||||
if (questGreeting->Greeting.size() > size_t(locale) && !questGreeting->Greeting.empty())
|
if (!questGreeting->Greeting.empty())
|
||||||
strGreeting = questGreeting->Greeting[locale];
|
{
|
||||||
|
LocaleConstant locale = _session->GetSessionDbLocaleIndex();
|
||||||
|
if (questGreeting->Greeting.size() > size_t(locale))
|
||||||
|
strGreeting = questGreeting->Greeting[locale];
|
||||||
|
else
|
||||||
|
strGreeting = questGreeting->Greeting[DEFAULT_LOCALE];
|
||||||
|
}
|
||||||
|
|
||||||
data << strGreeting;
|
data << strGreeting;
|
||||||
data << uint32(questGreeting->EmoteDelay);
|
data << uint32(questGreeting->EmoteDelay);
|
||||||
|
|||||||
Reference in New Issue
Block a user