Core/Quests: fixed sending a correct information to close the current quest menu after rewarding quests when the player is not enligible for the next rewarded quest

This commit is contained in:
Ovahlord
2019-05-18 03:07:02 +02:00
parent ab7a694ef9
commit f746940f33
2 changed files with 9 additions and 4 deletions

View File

@@ -16968,7 +16968,7 @@ void Player::SendQuestComplete(Quest const* quest) const
}
}
void Player::SendQuestReward(Quest const* quest, uint32 XP) const
void Player::SendQuestReward(Quest const* quest, uint32 XP)
{
uint32 questId = quest->GetQuestId();
sGameEventMgr->HandleQuestComplete(questId);
@@ -16996,8 +16996,13 @@ void Player::SendQuestReward(Quest const* quest, uint32 XP) const
data << uint32(questId);
data << uint32(quest->GetRewardSkillId()); // 4.x bonus skill id
data.WriteBit(0); // FIXME: unknown bits, common values sent
data.WriteBit(1);
bool canTakeNextRewardQuest = false;
if (uint32 nextQuestId = quest->GetNextQuestInChain())
if (Quest const* quest = sObjectMgr->GetQuestTemplate(nextQuestId))
canTakeNextRewardQuest = CanTakeQuest(quest, false);
data.WriteBit(0); // FIXME: unknown bit, common values sent
data.WriteBit(canTakeNextRewardQuest); // Can take next reward quest
data.FlushBits();
SendDirectMessage(&data);

View File

@@ -1441,7 +1441,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
bool CanShareQuest(uint32 questId) const;
void SendQuestComplete(Quest const* quest) const;
void SendQuestReward(Quest const* quest, uint32 XP) const;
void SendQuestReward(Quest const* quest, uint32 XP);
void SendQuestFailed(uint32 questId, InventoryResult reason = EQUIP_ERR_OK) const;
void SendQuestTimerFailed(uint32 questId) const;
void SendCanTakeQuestResponse(QuestFailedReason msg) const;