mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-17 16:10:49 +01:00
Core/Quests: Improve ItemRemovedQuestCheck logic (#26758)
Closes #25603
(cherry picked from commit 621f3f50c2)
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user