Core/Quests: Improve ItemRemovedQuestCheck logic (#26758)

Closes #25603

(cherry picked from commit 621f3f50c2)
This commit is contained in:
Gildor
2021-07-28 11:11:59 +02:00
committed by Shauren
parent 851735d808
commit 62df5e860f

View File

@@ -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)
{