diff --git a/NewHorizons/External/NewHorizonBody.cs b/NewHorizons/External/NewHorizonBody.cs index 79fef54d..2016d8d0 100644 --- a/NewHorizons/External/NewHorizonBody.cs +++ b/NewHorizons/External/NewHorizonBody.cs @@ -16,14 +16,6 @@ namespace NewHorizons.External Config = config; Mod = mod; RelativePath = relativePath; - - // Fall back to file name if name not given - if (!string.IsNullOrEmpty(relativePath) && string.IsNullOrEmpty(config.name)) - { - config.name = Path.GetFileNameWithoutExtension(relativePath); - } - - Migrate(); } public PlanetConfig Config; diff --git a/NewHorizons/Main.cs b/NewHorizons/Main.cs index 41827310..97b861ab 100644 --- a/NewHorizons/Main.cs +++ b/NewHorizons/Main.cs @@ -922,6 +922,12 @@ namespace NewHorizons BodyDict.Add(config.starSystem, new List()); } + // Fall back to file name if name not given + if (!string.IsNullOrEmpty(relativePath) && string.IsNullOrEmpty(config.name)) + { + config.name = Path.GetFileNameWithoutExtension(relativePath); + } + // Has to happen after we make sure theres a system config config.Validate(); config.Migrate();