Core/Quests: Improve ItemRemovedQuestCheck logic
Port From (https://github.com/TrinityCore/TrinityCore/commit/62df5e860fd3ecfcedbcca14a6d90bf5d8a1bbef)
This commit is contained in:
@@ -2277,12 +2277,7 @@ namespace Game.Entities
|
|||||||
if (!IsQuestObjectiveCompletable(logSlot, quest, objective))
|
if (!IsQuestObjectiveCompletable(logSlot, quest, objective))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
int curItemCount = GetQuestSlotObjectiveData(logSlot, objective);
|
int newItemCount = (int)GetItemCount(entry, false); // we may have more than what the status shows, so we have to iterate inventory
|
||||||
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);
|
|
||||||
|
|
||||||
if (newItemCount < objective.Amount)
|
if (newItemCount < objective.Amount)
|
||||||
{
|
{
|
||||||
SetQuestObjectiveData(objective, newItemCount);
|
SetQuestObjectiveData(objective, newItemCount);
|
||||||
|
|||||||
Reference in New Issue
Block a user