[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
This commit is contained in:
Xyventh
2017-04-23 23:55:07 +02:00
committed by ariel-
parent 6cc267d909
commit f0bf1fc77a

View File

@@ -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);
if (nextQuest->IsAutoAccept() && _player->CanAddQuest(nextQuest, true))
_player->AddQuestAndCheckCompletion(nextQuest, object);
_player->PlayerTalkClass->SendQuestGiverQuestDetails(nextQuest, guid, true);
}
_player->PlayerTalkClass->SendQuestGiverQuestDetails(nextQuest, guid, true);
}
questgiver->AI()->sQuestReward(_player, quest, reward);
}
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);
if (nextQuest->IsAutoAccept() && _player->CanAddQuest(nextQuest, true))
_player->AddQuestAndCheckCompletion(nextQuest, object);
_player->PlayerTalkClass->SendQuestGiverQuestDetails(nextQuest, guid, true);
}
_player->PlayerTalkClass->SendQuestGiverQuestDetails(nextQuest, guid, true);
}
questGiver->AI()->QuestReward(_player, quest, reward);
}
if (!sScriptMgr->OnQuestReward(_player, questGiver, quest, reward))
questGiver->AI()->QuestReward(_player, quest, reward);
break;
}
default: