Core/Quests: Fixed repeatable quest still showing as completable after completion

Signed-off-by: Machiavelli <[email protected]>
This commit is contained in:
Shauren
2010-12-29 13:14:51 +01:00
committed by Machiavelli
parent 92460b4aab
commit 82f471cc13
+7 -7
View File
@@ -14238,15 +14238,14 @@ bool Player::CanCompleteQuest(uint32 quest_id)
{
if (quest_id)
{
RewardedQuestSet::iterator rewItr = m_RewardedQuests.find(quest_id);
if (rewItr != m_RewardedQuests.end())
return false; // not allow re-complete quest
Quest const* qInfo = sObjectMgr->GetQuestTemplate(quest_id);
if (!qInfo)
return false;
RewardedQuestSet::iterator rewItr = m_RewardedQuests.find(quest_id);
if (!qInfo->IsRepeatable() && rewItr != m_RewardedQuests.end())
return false; // not allow re-complete quest
// auto complete quest
if ((qInfo->IsAutoComplete() || qInfo->GetFlags() & QUEST_FLAGS_AUTOCOMPLETE) && CanTakeQuest(qInfo, false))
return true;
@@ -15182,8 +15181,9 @@ QuestStatus Player::GetQuestStatus(uint32 quest_id) const
if (itr != m_QuestStatus.end())
return itr->second.m_status;
if (m_RewardedQuests.find(quest_id) != m_RewardedQuests.end())
return QUEST_STATUS_COMPLETE;
if (Quest const* qInfo = sObjectMgr->GetQuestTemplate(quest_id))
if (!qInfo->IsRepeatable() && m_RewardedQuests.find(quest_id) != m_RewardedQuests.end())
return QUEST_STATUS_COMPLETE;
}
return QUEST_STATUS_NONE;
}