Core/Quests: check if a player can take the next quest provided by its query data before trying to request its details

This commit is contained in:
Ovahlord
2021-07-25 14:57:15 +02:00
parent a36e52e587
commit 7648eff6db

View File

@@ -16519,7 +16519,8 @@ void Player::SendQuestReward(Quest const* quest, Creature const* questGiver, uin
if (questGiver->IsGossip() && quest->HasFlag(QUEST_FLAGS_LAUNCH_GOSSIP_COMPLETE))
packet.LaunchGossip = true;
else if (quest->GetNextQuestInChain() && !quest->HasFlag(QUEST_FLAGS_AUTOCOMPLETE))
packet.UseQuestReward = true;
if (Quest const* quest = sObjectMgr->GetQuestTemplate(quest->GetNextQuestInChain()))
packet.UseQuestReward = CanTakeQuest(quest, false);
}
SendDirectMessage(packet.Write());