Jump to content

[Fix][7683] ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST for daily quest


Recommended Posts

Posted

Description of the bug?

The criteria ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST is never marked completed for Daily quest. (or just repeatable, btw)

For which repository revision was the patch created?

7664

Is there a thread in the bug report section or at lighthouse?

None I know

Who has been writing this patch?

Myself

Fix:

The check was done on GetQuestRewardStatus which is always false for daily or repeatable quest.

When the quest is completed, I pass the quest_id of the completed quest to the UpdateAchievementCriteria to check the id of the quest directly.

No change at login.

diff --git a/src/game/AchievementMgr.cpp b/src/game/AchievementMgr.cpp
index 1b8338a..666d93a 100644
--- a/src/game/AchievementMgr.cpp
+++ b/src/game/AchievementMgr.cpp
@@ -789,8 +789,18 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
                SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE);
                break;
            case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST:
-                if(GetPlayer()->GetQuestRewardStatus(achievementCriteria->complete_quest.questID))
-                    SetCriteriaProgress(achievementCriteria, 1);
+                // if miscvalues != 0, it contains the questID.
+                if (miscvalue1)
+                {
+                    if (miscvalue1 == achievementCriteria->complete_quest.questID)
+                        SetCriteriaProgress(achievementCriteria, 1);
+                }
+                else
+                {
+                    // login case.
+                    if(GetPlayer()->GetQuestRewardStatus(achievementCriteria->complete_quest.questID))
+                        SetCriteriaProgress(achievementCriteria, 1);
+                }
                break;
            case ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET:
            case ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2:
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 9f59951..df6907d 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -12412,7 +12412,7 @@ void Player::RewardQuest( Quest const *pQuest, uint32 reward, Object* questGiver
    if (pQuest->GetZoneOrSort() > 0)
        GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_IN_ZONE, pQuest->GetZoneOrSort());
    GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST_COUNT);
-    GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST);
+    GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST, pQuest->GetQuestId());

    uint32 zone = 0;
    uint32 area = 0;

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use