Core/Quests: Improve ItemRemovedQuestCheck logic

Port From (https://github.com/TrinityCore/TrinityCore/commit/62df5e860fd3ecfcedbcca14a6d90bf5d8a1bbef)
This commit is contained in:
hondacrx
2022-05-29 16:08:45 -04:00
parent df7218cae5
commit 60ab157ba1
+1 -6
View File
@@ -2277,12 +2277,7 @@ namespace Game.Entities
if (!IsQuestObjectiveCompletable(logSlot, quest, objective))
continue;
int curItemCount = GetQuestSlotObjectiveData(logSlot, objective);
if (curItemCount >= objective.Amount) // we may have more than what the status shows
curItemCount = (int)GetItemCount(entry, false);
int newItemCount = (int)((count > curItemCount) ? 0 : curItemCount - count);
int newItemCount = (int)GetItemCount(entry, false); // we may have more than what the status shows, so we have to iterate inventory
if (newItemCount < objective.Amount)
{
SetQuestObjectiveData(objective, newItemCount);