diff options
author | Xyventh <xyventh@protonmail.com> | 2017-04-23 23:55:07 +0200 |
---|---|---|
committer | ariel- <ariel-@users.noreply.github.com> | 2017-04-23 18:55:07 -0300 |
commit | f0bf1fc77aa304ad278618aae25274ed46d308d5 (patch) | |
tree | dd1f7c62846da67b05677431fed0c56d65efa180 | |
parent | 6cc267d90918a0663f928db302ef1465f7952c61 (diff) |
[3.3.5] Core/Quest: always send the specified RewardNextQuest regardless of eventual scripts (#19498)
- Fixes certain situations in which the quest window would get stuck after completing a quest
-rw-r--r-- | src/server/game/Handlers/QuestHandler.cpp | 44 |
1 files changed, 20 insertions, 24 deletions
diff --git a/src/server/game/Handlers/QuestHandler.cpp b/src/server/game/Handlers/QuestHandler.cpp index 4c464b9df63..c549a49adf3 100644 --- a/src/server/game/Handlers/QuestHandler.cpp +++ b/src/server/game/Handlers/QuestHandler.cpp @@ -303,45 +303,41 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket& recvData) case TYPEID_UNIT: { Creature* questgiver = object->ToCreature(); - if (!sScriptMgr->OnQuestReward(_player, questgiver, quest, reward)) + // Send next quest + if (Quest const* nextQuest = _player->GetNextQuest(guid, quest)) { - // Send next quest - if (Quest const* nextQuest = _player->GetNextQuest(guid, quest)) + // Only send the quest to the player if the conditions are met + if (_player->CanTakeQuest(nextQuest, false)) { - // Only send the quest to the player if the conditions are met - if (_player->CanTakeQuest(nextQuest, false)) - { - if (nextQuest->IsAutoAccept() && _player->CanAddQuest(nextQuest, true)) - _player->AddQuestAndCheckCompletion(nextQuest, object); - - _player->PlayerTalkClass->SendQuestGiverQuestDetails(nextQuest, guid, true); - } + if (nextQuest->IsAutoAccept() && _player->CanAddQuest(nextQuest, true)) + _player->AddQuestAndCheckCompletion(nextQuest, object); + + _player->PlayerTalkClass->SendQuestGiverQuestDetails(nextQuest, guid, true); } + } + if (!sScriptMgr->OnQuestReward(_player, questgiver, quest, reward)) questgiver->AI()->sQuestReward(_player, quest, reward); - } break; } case TYPEID_GAMEOBJECT: { GameObject* questGiver = object->ToGameObject(); - if (!sScriptMgr->OnQuestReward(_player, questGiver, quest, reward)) + // Send next quest + if (Quest const* nextQuest = _player->GetNextQuest(guid, quest)) { - // Send next quest - if (Quest const* nextQuest = _player->GetNextQuest(guid, quest)) + // Only send the quest to the player if the conditions are met + if (_player->CanTakeQuest(nextQuest, false)) { - // Only send the quest to the player if the conditions are met - if (_player->CanTakeQuest(nextQuest, false)) - { - if (nextQuest->IsAutoAccept() && _player->CanAddQuest(nextQuest, true)) - _player->AddQuestAndCheckCompletion(nextQuest, object); - - _player->PlayerTalkClass->SendQuestGiverQuestDetails(nextQuest, guid, true); - } + if (nextQuest->IsAutoAccept() && _player->CanAddQuest(nextQuest, true)) + _player->AddQuestAndCheckCompletion(nextQuest, object); + + _player->PlayerTalkClass->SendQuestGiverQuestDetails(nextQuest, guid, true); } + } + if (!sScriptMgr->OnQuestReward(_player, questGiver, quest, reward)) questGiver->AI()->QuestReward(_player, quest, reward); - } break; } default: |