fix(CORE/Quests): Quest dialog fails to close with follow-up quest (#6309)

- Fixes the problem with the quest dialog which doesn't close/update on a follow-up quest if there is no space in the inventory
- Closes: https://github.com/azerothcore/azerothcore-wotlk/issues/6296
This commit is contained in:
buddiman
2021-06-18 17:05:29 +02:00
committed by GitHub
parent 8214873e28
commit 4811a14bd6

View File

@@ -297,10 +297,22 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket& recvData)
// Send next quest
if (Quest const* nextQuest = _player->GetNextQuest(guid, quest))
{
if (_player->CanAddQuest(nextQuest, false) && _player->CanTakeQuest(nextQuest, false))
if (_player->CanTakeQuest(nextQuest, false))
{
if (nextQuest->IsAutoAccept())
_player->AddQuestAndCheckCompletion(nextQuest, object);
{
// QUEST_FLAGS_AUTO_ACCEPT was not used by Blizzard.
if (_player->CanAddQuest(nextQuest, false))
{
_player->AddQuestAndCheckCompletion(nextQuest, object);
}
else
{
// Auto accept is set for a custom quest and there is no inventory space
_player->PlayerTalkClass->SendCloseGossip();
break;
}
}
_player->PlayerTalkClass->SendQuestGiverQuestDetails(nextQuest, guid, true);
}
}