Logging Change for EF Core, and Simulation fix
This commit is contained in:
@@ -3069,14 +3069,16 @@ public sealed partial class DungeonHandler : IClientMessageHandler
|
||||
var mobsWithLoot = instance.Simulation.Mobs.Values
|
||||
.Where(m => m.HasCarriedLoot)
|
||||
.ToDictionary(m => m.Id, m => m);
|
||||
|
||||
|
||||
if (mobsWithLoot.Count > 0)
|
||||
{
|
||||
_log.LogInformation("Preserving {Count} mobs with carried player loot during respawn", mobsWithLoot.Count);
|
||||
}
|
||||
|
||||
// Create a fresh simulation with the same parameters
|
||||
var layout = DungeonGenerator.Generate(instance.Seed, instance.Tier);
|
||||
|
||||
// IMPORTANT: Reuse the existing layout to preserve mob spawn positions!
|
||||
// Using DungeonGenerator.Generate() would create a V1 layout which has different
|
||||
// room geometry than V2/V3, causing mobs to spawn in wrong positions.
|
||||
var layout = instance.Simulation.Layout;
|
||||
var freshSimulation = new DungeonSimulation(layout, instance.Tier, _mobDefinitions, instance.LevelBracketMin, null, _mobSpriteConfigs);
|
||||
|
||||
// Clear and rebuild mobs, keeping those with loot
|
||||
|
||||
Reference in New Issue
Block a user