Builder changes
This commit is contained in:
@@ -472,7 +472,10 @@ public sealed partial class DungeonHandler
|
||||
{
|
||||
try
|
||||
{
|
||||
var layout = DungeonGenerator.Generate(persisted.Seed, persisted.Tier);
|
||||
using var scope = _scopeFactory.CreateScope();
|
||||
var db = scope.ServiceProvider.GetRequiredService<GameDbContext>();
|
||||
var vnext = new DungeonGeneratorVNext(db, persisted.Seed, persisted.Tier);
|
||||
var layout = await vnext.GenerateAsync();
|
||||
var simulation = new DungeonSimulation(layout, persisted.Tier, _mobDefinitions, persisted.LevelBracketMin, _abilityDefinitions, _mobSpriteConfigs, _abilityAnimationMappings);
|
||||
var mobStatePayload = DeserializePersistedMobPayload(persisted.MobStateJson);
|
||||
var persistedMobStates = mobStatePayload?.Mobs;
|
||||
@@ -618,9 +621,7 @@ public sealed partial class DungeonHandler
|
||||
_log.LogInformation("Preserving {Count} mobs with carried player loot during respawn", mobsWithLoot.Count);
|
||||
}
|
||||
|
||||
// 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.
|
||||
// IMPORTANT: Reuse the existing layout to preserve mob spawn positions.
|
||||
var layout = instance.Simulation.Layout;
|
||||
var freshSimulation = new DungeonSimulation(layout, instance.Tier, _mobDefinitions, instance.LevelBracketMin, _abilityDefinitions, _mobSpriteConfigs, _abilityAnimationMappings);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user