Looting fix
This commit is contained in:
@@ -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<int>();
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user