Core/Loot: Fixed iterator invalidation crash in WorldSession::HandleLootMoneyOpcode
Port From (https://github.com/TrinityCore/TrinityCore/commit/81cf682cfe0ba30931f9588f83e1e072325defce)
This commit is contained in:
@@ -86,6 +86,7 @@ namespace Game
|
|||||||
void HandleLootMoney(LootMoney lootMoney)
|
void HandleLootMoney(LootMoney lootMoney)
|
||||||
{
|
{
|
||||||
Player player = GetPlayer();
|
Player player = GetPlayer();
|
||||||
|
List<Loot> forceLootRelease = new();
|
||||||
|
|
||||||
foreach (var lootView in player.GetAELootView())
|
foreach (var lootView in player.GetAELootView())
|
||||||
{
|
{
|
||||||
@@ -150,8 +151,11 @@ namespace Game
|
|||||||
|
|
||||||
// Delete container if empty
|
// Delete container if empty
|
||||||
if (loot.IsLooted() && guid.IsItem())
|
if (loot.IsLooted() && guid.IsItem())
|
||||||
player.GetSession().DoLootRelease(loot);
|
forceLootRelease.Add(loot);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (Loot loot in forceLootRelease)
|
||||||
|
player.GetSession().DoLootRelease(loot);
|
||||||
}
|
}
|
||||||
|
|
||||||
class AELootCreatureCheck : ICheck<Creature>
|
class AELootCreatureCheck : ICheck<Creature>
|
||||||
|
|||||||
Reference in New Issue
Block a user