diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 8e78030d4..81d9cbaca 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -7503,7 +7503,7 @@ bool PlayerCondition::Meets(Player const * player) const return player->GetQuestRewardStatus(value1); case CONDITION_QUESTTAKEN: { - return player->IsCurrentQuest(value1); + return player->IsCurrentQuest(value1, value2); } case CONDITION_AD_COMMISSION_AURA: { @@ -7770,7 +7770,7 @@ bool PlayerCondition::IsValid(ConditionType condition, uint32 value1, uint32 val return false; } - if (value2) + if (value2 && condition != CONDITION_QUESTTAKEN) sLog.outErrorDb("Quest condition (%u) has useless data in value2 (%u)!", condition, value2); break; } diff --git a/src/game/Player.cpp b/src/game/Player.cpp index efcdd75ba..e97826e68 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -13522,13 +13522,21 @@ bool Player::IsActiveQuest( uint32 quest_id ) const return itr != mQuestStatus.end() && itr->second.m_status != QUEST_STATUS_NONE; } -bool Player::IsCurrentQuest( uint32 quest_id ) const +bool Player::IsCurrentQuest(uint32 quest_id, uint8 completed_or_not) const { QuestStatusMap::const_iterator itr = mQuestStatus.find(quest_id); if (itr == mQuestStatus.end()) return false; - return itr->second.m_status == QUEST_STATUS_INCOMPLETE || (itr->second.m_status == QUEST_STATUS_COMPLETE && !itr->second.m_rewarded); + switch (completed_or_not) + { + case 1: + return itr->second.m_status == QUEST_STATUS_INCOMPLETE; + case 2: + return itr->second.m_status == QUEST_STATUS_COMPLETE && !itr->second.m_rewarded; + default: + return itr->second.m_status == QUEST_STATUS_INCOMPLETE || (itr->second.m_status == QUEST_STATUS_COMPLETE && !itr->second.m_rewarded); + } } Quest const* Player::GetNextQuest(ObjectGuid guid, Quest const *pQuest) diff --git a/src/game/Player.h b/src/game/Player.h index d0724510f..4c8669b7b 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -1320,7 +1320,13 @@ class MANGOS_DLL_SPEC Player : public Unit void PrepareQuestMenu(ObjectGuid guid ); void SendPreparedQuest(ObjectGuid guid); bool IsActiveQuest( uint32 quest_id ) const; // can be taken or taken - bool IsCurrentQuest( uint32 quest_id ) const; // taken and not yet rewarded + + // Quest is taken and not yet rewarded + // if completed_or_not = 0 (or any other value except 1 or 2) - returns true, if quest is taken and doesn't depend if quest is completed or not + // if completed_or_not = 1 - returns true, if quest is taken but not completed + // if completed_or_not = 2 - returns true, if quest is taken and already completed + bool IsCurrentQuest(uint32 quest_id, uint8 completed_or_not = 0) const; // taken and not yet rewarded + Quest const *GetNextQuest(ObjectGuid guid, Quest const *pQuest ); bool CanSeeStartQuest( Quest const *pQuest ) const; bool CanTakeQuest( Quest const *pQuest, bool msg ) const; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 0e8018652..002ba1285 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "11821" + #define REVISION_NR "11822" #endif // __REVISION_NR_H__