diff --git a/Torch.Server/Managers/InstanceManager.cs b/Torch.Server/Managers/InstanceManager.cs index d6141c6..a4e4a9e 100644 --- a/Torch.Server/Managers/InstanceManager.cs +++ b/Torch.Server/Managers/InstanceManager.cs @@ -128,7 +128,15 @@ namespace Torch.Server.Managers return; } - SelectWorld(DedicatedConfig.LoadWorld ?? DedicatedConfig.Worlds.First().WorldPath, false); + var worldPath = DedicatedConfig.LoadWorld; + + if (worldPath == null) + worldPath = DedicatedConfig.Worlds.First().WorldPath; + else + // make sure we won't end up with a file path when we expect it to be a directory + worldPath = Path.EndsInDirectorySeparator(worldPath) ? worldPath : Path.GetDirectoryName(worldPath); + + SelectWorld(worldPath, false); _instanceLoaded?.Invoke(DedicatedConfig); }