Core/GameObjects: Only start loot restock timer if loot contents were modified and ignore it for personal loot

Port From (https://github.com/TrinityCore/TrinityCore/commit/a3ef01f87bd56e553972277a38cf9a98a3397495)
This commit is contained in:
hondacrx
2023-07-18 07:43:30 -04:00
parent 7de6a839fa
commit a700760b88
3 changed files with 19 additions and 7 deletions
+13 -1
View File
@@ -728,6 +728,12 @@ namespace Game.Loots
return allLooted;
}
public void LootMoney()
{
gold = 0;
_changed = true;
}
public LootItem GetItemInSlot(uint lootListId)
{
if (lootListId < items.Count)
@@ -902,6 +908,9 @@ namespace Game.Loots
if (!lootRoll.TryToStart(map, this, lootListId, maxEnchantingSkill))
_rolls.Remove(lootListId);
}
if (!_rolls.Empty())
_changed = true;
}
else if (_lootMethod == LootMethod.MasterLoot)
{
@@ -973,6 +982,7 @@ namespace Game.Loots
if (is_looted)
return null;
_changed = true;
return item;
}
@@ -1064,7 +1074,8 @@ namespace Game.Loots
}
public bool IsLooted() { return gold == 0 && unlootedCount == 0; }
public bool IsChanged() { return _changed; }
public void AddLooter(ObjectGuid guid) { PlayersLooting.Add(guid); }
public void RemoveLooter(ObjectGuid guid) { PlayersLooting.Remove(guid); }
@@ -1099,6 +1110,7 @@ namespace Game.Loots
ObjectGuid _lootMaster;
List<ObjectGuid> _allowedLooters = new();
bool _wasOpened; // true if at least one player received the loot content
bool _changed;
uint _dungeonEncounterId;
}