Core/Loot: Properly clear tracked looted objects with item loot

Port From (https://github.com/TrinityCore/TrinityCore/commit/0461826689dad8f318e86395ce1060c8f29f7920)
This commit is contained in:
hondacrx
2021-03-29 16:46:09 -04:00
parent 047a6babfc
commit 9e26d8dad5
2 changed files with 11 additions and 8 deletions
+3 -2
View File
@@ -317,7 +317,9 @@ namespace Game
if (player.GetLootGUID() == lguid)
player.SetLootGUID(ObjectGuid.Empty);
player.SendLootRelease(lguid);
player.RemoveAELootedWorldObject(lguid);
player.RemoveUnitFlag(UnitFlags.Looting);
@@ -387,7 +389,7 @@ namespace Game
ItemTemplate proto = pItem.GetTemplate();
// destroy only 5 items from stack in case prospecting and milling
if (proto.GetFlags().HasAnyFlag(ItemFlags.IsProspectable | ItemFlags.IsMillable))
if (pItem.loot.loot_type == LootType.Prospecting || pItem.loot.loot_type == LootType.Milling)
{
pItem.m_lootGenerated = false;
pItem.loot.Clear();
@@ -448,7 +450,6 @@ namespace Game
//Player is not looking at loot list, he doesn't need to see updates on the loot list
loot.RemoveLooter(player.GetGUID());
player.RemoveAELootedObject(loot.GetGUID());
}
void DoLootReleaseAll()