Dont explode

This commit is contained in:
xen-42 2024-10-03 00:52:02 -04:00
parent 42f898a3fa
commit dc1a0b0832

View File

@ -909,8 +909,15 @@ namespace NewHorizons
{ {
if (!SystemDict.ContainsKey(config.starSystem)) if (!SystemDict.ContainsKey(config.starSystem))
{ {
NHLogger.LogError($"System config for {config.starSystem} does not exist?"); var starSystemConfig = new StarSystemConfig() { name = config.starSystem };
return null; starSystemConfig.Migrate();
starSystemConfig.FixCoordinates();
var system = new NewHorizonsSystem(config.starSystem, starSystemConfig, $"", mod);
SystemDict.Add(config.starSystem, system);
BodyDict.Add(config.starSystem, new List<NewHorizonsBody>());
} }
// Has to happen after we make sure theres a system config // Has to happen after we make sure theres a system config