diff --git a/Game/Dungeon/DungeonHandler.cs b/Game/Dungeon/DungeonHandler.cs index 076b21c..ada77a5 100644 --- a/Game/Dungeon/DungeonHandler.cs +++ b/Game/Dungeon/DungeonHandler.cs @@ -1765,11 +1765,8 @@ public sealed partial class DungeonHandler : IClientMessageHandler mob.DeathLoot = allItems; mob.DeathLootGold = totalGold; - // If mob has no loot, mark it for corpse removal - if (!mob.HasDeathLoot && dungeon != null) - { - mob.LootEmptiedAtTick = dungeon.Simulation.CurrentTick; - } + // Don't set LootEmptiedAtTick here - let the simulation do it when dungeon is cleared + // This way corpses stay during combat even if they have no loot _log.LogDebug("Mob {Mob} died with {Count} items and {Gold} gold loot", mob.Name, allItems.Count, totalGold); diff --git a/Game/Dungeon/DungeonSimulation.cs b/Game/Dungeon/DungeonSimulation.cs index a1172e6..ec9ac2b 100644 --- a/Game/Dungeon/DungeonSimulation.cs +++ b/Game/Dungeon/DungeonSimulation.cs @@ -374,21 +374,24 @@ public partial class DungeonSimulation UpdatePlayer(player); } - // Handle corpse cleanup (remove corpses 10 seconds after loot is empty) + // Handle corpse cleanup (remove corpses 30 seconds after loot is empty AND dungeon is cleared) var corpsesToRemove = new List(); - foreach (var mob in Mobs.Values.Where(m => !m.IsAlive)) + if (Phase == DungeonPhase.Cleared) { - // Check if loot just became empty - if (!mob.HasDeathLoot && !mob.LootEmptiedAtTick.HasValue) + foreach (var mob in Mobs.Values.Where(m => !m.IsAlive)) { - mob.LootEmptiedAtTick = CurrentTick; - } + // Check if loot just became empty + if (!mob.HasDeathLoot && !mob.LootEmptiedAtTick.HasValue) + { + mob.LootEmptiedAtTick = CurrentTick; + } - // Remove corpse 10 seconds after loot emptied (10 ticks per second) - if (mob.LootEmptiedAtTick.HasValue && - CurrentTick - mob.LootEmptiedAtTick.Value >= 10 * TicksPerSecond) - { - corpsesToRemove.Add(mob.Id); + // Remove corpse 30 seconds after loot emptied (10 ticks per second) + if (mob.LootEmptiedAtTick.HasValue && + CurrentTick - mob.LootEmptiedAtTick.Value >= 30 * TicksPerSecond) + { + corpsesToRemove.Add(mob.Id); + } } }