Core/Player: Fix not being able to do seasonal quests(if already done in the past)

This commit is contained in:
w1sht0l1v3 committed 2015-10-25 18:22:57 +02:00
1 parent 11f0c85bd4
commit 1ef1d42d14
1 file changed
+19
@@ -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;
}