Fix post world generation behavior

This commit is contained in:
John Gross
2019-01-17 15:07:50 -08:00
parent 36b931f680
commit b66db19c0a
2 changed files with 9 additions and 2 deletions

View File

@@ -87,7 +87,15 @@ namespace Torch.Server.Managers
public void SelectWorld(string worldPath, bool modsOnly = true)
{
DedicatedConfig.LoadWorld = worldPath;
DedicatedConfig.SelectedWorld = DedicatedConfig.Worlds.FirstOrDefault(x => x.WorldPath == worldPath);
var worldInfo = DedicatedConfig.Worlds.FirstOrDefault(x => x.WorldPath == worldPath);
if (worldInfo?.Checkpoint == null)
{
worldInfo = new WorldViewModel(worldPath);
DedicatedConfig.Worlds.Add(worldInfo);
}
DedicatedConfig.SelectedWorld = worldInfo;
if (DedicatedConfig.SelectedWorld?.Checkpoint != null)
{
DedicatedConfig.Mods.Clear();

View File

@@ -93,7 +93,6 @@ namespace Torch.Server
_instanceManager.SelectWorld(worldPath, false);
_instanceManager.LoadInstance(worldPath);
_instanceManager.ImportSelectedWorldConfig();
Close();
}