diff options
author | w1sht0l1v3 <w1sht0l1v3@gmail.com> | 2015-10-25 18:22:57 +0200 |
---|---|---|
committer | w1sht0l1v3 <w1sht0l1v3@gmail.com> | 2015-10-25 18:22:57 +0200 |
commit | 1ef1d42d145c18579a7e7ca15cebb38485bc0cff (patch) | |
tree | 016197b05b7f07288028ece21b1d0c9a16bcd7a9 | |
parent | 11f0c85bd48e7d487609c1a5a82d7e544ca8d84e (diff) |
Core/Player: Fix not being able to do seasonal quests(if already done in the past)
-rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index bfcdb7a8f57..93e1b0c6181 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -15906,6 +15906,16 @@ bool Player::GetQuestRewardStatus(uint32 quest_id) const Quest const* qInfo = sObjectMgr->GetQuestTemplate(quest_id); if (qInfo) { + if (qInfo->IsSeasonal() && !qInfo->IsRepeatable()) + { + uint16 eventId = sGameEventMgr->GetEventIdForQuest(qInfo); + if (m_seasonalquests.find(eventId) != m_seasonalquests.end()) + return m_seasonalquests.find(eventId)->second.find(quest_id) == m_seasonalquests.find(eventId)->second.end(); + + return false; + } + + // for repeatable quests: rewarded field is set after first reward only to prevent getting XP more than once if (!qInfo->IsRepeatable()) return m_RewardedQuests.find(quest_id) != m_RewardedQuests.end(); @@ -15924,8 +15934,17 @@ QuestStatus Player::GetQuestStatus(uint32 quest_id) const return itr->second.Status; if (Quest const* qInfo = sObjectMgr->GetQuestTemplate(quest_id)) + { + if (qInfo->IsSeasonal() && !qInfo->IsRepeatable()) + { + uint16 eventId = sGameEventMgr->GetEventIdForQuest(qInfo); + if (m_seasonalquests.find(eventId) == m_seasonalquests.end() || m_seasonalquests.find(eventId)->second.find(quest_id) == m_seasonalquests.find(eventId)->second.end()) + return QUEST_STATUS_NONE; + } + if (!qInfo->IsRepeatable() && m_RewardedQuests.find(quest_id) != m_RewardedQuests.end()) return QUEST_STATUS_REWARDED; + } } return QUEST_STATUS_NONE; } |