From 72b1f2e7a4507eae2102a9ff883affae03ddd018 Mon Sep 17 00:00:00 2001 From: Wyrserth Date: Thu, 20 Jun 2019 08:11:29 +0200 Subject: Core/Conditions: fix mistake in CONDITION_QUEST_OBJECTIVE_PROGRESS that would behave wrongly if the player did not have the quest in the quest log. (#23447) --- src/server/game/Conditions/ConditionMgr.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/server/game/Conditions') diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 74c168599bf..122cd65a173 100644 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -507,10 +507,9 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) const { const Quest* quest = sObjectMgr->GetQuestTemplate(ConditionValue1); uint16 log_slot = player->FindQuestSlot(quest->GetQuestId()); - uint32 progressCount = 0; - if (log_slot < MAX_QUEST_LOG_SIZE) - progressCount = player->GetQuestSlotCounter(log_slot, ConditionValue2); - if (progressCount == ConditionValue3) + if (log_slot >= MAX_QUEST_LOG_SIZE) + break; + if (player->GetQuestSlotCounter(log_slot, ConditionValue2) == ConditionValue3) condMeets = true; } break; -- cgit v1.2.3