From 62df5e860fd3ecfcedbcca14a6d90bf5d8a1bbef Mon Sep 17 00:00:00 2001 From: Gildor Date: Wed, 28 Jul 2021 11:11:59 +0200 Subject: Core/Quests: Improve ItemRemovedQuestCheck logic (#26758) Closes #25603 (cherry picked from commit 621f3f50c2fa2ce098ff13ad12a0bbc772300e2f) --- src/server/game/Entities/Player/Player.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/server') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 188294332ac..2fcf09032c2 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -16931,7 +16931,7 @@ void Player::ItemAddedQuestCheck(uint32 entry, uint32 count) UpdateQuestObjectiveProgress(QUEST_OBJECTIVE_ITEM, entry, count); } -void Player::ItemRemovedQuestCheck(uint32 entry, uint32 count) +void Player::ItemRemovedQuestCheck(uint32 entry, uint32 /*count*/) { for (QuestObjectiveStatusMap::value_type const& objectiveItr : Trinity::Containers::MapEqualRange(m_questObjectiveStatus, { QUEST_OBJECTIVE_ITEM, entry })) { @@ -16943,11 +16943,7 @@ void Player::ItemRemovedQuestCheck(uint32 entry, uint32 count) if (!IsQuestObjectiveCompletable(logSlot, quest, objective)) continue; - int32 curItemCount = GetQuestSlotObjectiveData(logSlot, objective); - if (curItemCount >= objective.Amount) // we may have more than what the status shows - curItemCount = GetItemCount(entry, false); - - int32 newItemCount = (int32(count) > curItemCount) ? 0 : curItemCount - count; + int32 newItemCount = GetItemCount(entry, false); // we may have more than what the status shows, so we have to iterate inventory if (newItemCount < objective.Amount) { -- cgit v1.2.3