aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Handlers/QuestHandler.cpp
diff options
context:
space:
mode:
authorAqua Deus <95978183+aquadeus@users.noreply.github.com>2023-08-24 16:24:58 +0200
committerGitHub <noreply@github.com>2023-08-24 16:24:58 +0200
commita9d459962b221fd2033efa02f059b602c5a546f6 (patch)
treea4c2d063b925e3b5012c8f3940b22c821f6e34d4 /src/server/game/Handlers/QuestHandler.cpp
parent6175467c3e66fa09d8ff1e0f091375c26f7529e5 (diff)
Core/Quest: Allow quests flagged as QUEST_FLAGS_AUTO_COMPLETE to be valid in CMSG_QUESTGIVER_REQUEST_REWARD (#29244)
Co-authored-by: Ovahlord <dreadkiller@gmx.de>
Diffstat (limited to 'src/server/game/Handlers/QuestHandler.cpp')
-rw-r--r--src/server/game/Handlers/QuestHandler.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/server/game/Handlers/QuestHandler.cpp b/src/server/game/Handlers/QuestHandler.cpp
index e4d33fb37cd..03350379b7f 100644
--- a/src/server/game/Handlers/QuestHandler.cpp
+++ b/src/server/game/Handlers/QuestHandler.cpp
@@ -411,13 +411,20 @@ void WorldSession::HandleQuestgiverRequestRewardOpcode(WorldPackets::Quest::Ques
{
TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_REQUEST_REWARD npc = {}, quest = {}", packet.QuestGiverGUID.ToString(), packet.QuestID);
- Object* object = ObjectAccessor::GetObjectByTypeMask(*_player, packet.QuestGiverGUID, TYPEMASK_UNIT | TYPEMASK_GAMEOBJECT);
- if (!object || !object->hasInvolvedQuest(packet.QuestID))
+ Quest const* quest = sObjectMgr->GetQuestTemplate(packet.QuestID);
+ if (!quest)
return;
- // some kind of WPE protection
- if (!_player->CanInteractWithQuestGiver(object))
- return;
+ if (!quest->HasFlag(QUEST_FLAGS_AUTO_COMPLETE))
+ {
+ Object* object = ObjectAccessor::GetObjectByTypeMask(*_player, packet.QuestGiverGUID, TYPEMASK_UNIT | TYPEMASK_GAMEOBJECT);
+ if (!object || !object->hasInvolvedQuest(packet.QuestID))
+ return;
+
+ // some kind of WPE protection
+ if (!_player->CanInteractWithQuestGiver(object))
+ return;
+ }
if (_player->CanCompleteQuest(packet.QuestID))
_player->CompleteQuest(packet.QuestID);
@@ -425,7 +432,7 @@ void WorldSession::HandleQuestgiverRequestRewardOpcode(WorldPackets::Quest::Ques
if (_player->GetQuestStatus(packet.QuestID) != QUEST_STATUS_COMPLETE)
return;
- if (Quest const* quest = sObjectMgr->GetQuestTemplate(packet.QuestID))
+ if (quest)
_player->PlayerTalkClass->SendQuestGiverOfferReward(quest, packet.QuestGiverGUID, true);
}