diff --git a/Game/Dungeon/DungeonHandler.Dungeons.cs b/Game/Dungeon/DungeonHandler.Dungeons.cs index c811cb3..f14fb2d 100644 --- a/Game/Dungeon/DungeonHandler.Dungeons.cs +++ b/Game/Dungeon/DungeonHandler.Dungeons.cs @@ -636,6 +636,18 @@ public sealed partial class DungeonHandler } } + // Reset runtime combat/animation state for all living mobs after a dungeon reset. + foreach (var mob in instance.Simulation.Mobs.Values.Where(m => m.IsAlive)) + { + mob.State = MobState.Idle; + mob.StateTime = 0f; + mob.StuckTime = 0f; + mob.TargetId = null; + mob.CastingAbility = null; + mob.CastTimeRemaining = 0f; + mob.CurrentAnimation = mob.GetDirectionalAnimation("idle"); + } + // Reset chest states (they respawn closed) - but NOT loot chests foreach (var chest in instance.Simulation.Chests.Values) { @@ -648,13 +660,10 @@ public sealed partial class DungeonHandler // DON'T clear dropped items - these might be important! // instance.Simulation.DroppedItems.Clear(); - // Reset portals (exit portal should be inactive until boss killed) + // Reset portals to default active state. foreach (var portal in instance.Simulation.Portals.Values) { - if (portal.Type == PortalType.Exit) - { - portal.IsActive = false; - } + portal.IsActive = true; } _log.LogDebug("Respawned {MobCount} mobs in dungeon {Id} (preserved {PreservedCount} with loot, bossesRespawn={BossesRespawn})", diff --git a/Game/Dungeon/DungeonHandler.cs b/Game/Dungeon/DungeonHandler.cs index 9c22b3b..ba0194b 100644 --- a/Game/Dungeon/DungeonHandler.cs +++ b/Game/Dungeon/DungeonHandler.cs @@ -843,8 +843,11 @@ public sealed partial class DungeonHandler : IClientMessageHandler name = m.Name, x = m.X, y = m.Y, + rotation = m.Rotation, health = m.Health, maxHealth = m.MaxHealth, + state = m.State.ToString().ToLower(), + isAlive = m.IsAlive, spriteConfig = DeserializeSpriteConfigSafe(m.SpriteConfigJson), tintColor = m.TintColor, scale = m.Scale