diff --git a/NewHorizons/External/Modules/SpawnModule.cs b/NewHorizons/External/Modules/SpawnModule.cs index a73beb3f..5e2d0377 100644 --- a/NewHorizons/External/Modules/SpawnModule.cs +++ b/NewHorizons/External/Modules/SpawnModule.cs @@ -29,6 +29,10 @@ namespace NewHorizons.External.Modules /// If you spawn on a planet with no oxygen, you probably want to set this to true ;;) /// public bool startWithSuit; + /// + /// Whether this planet's spawn point is the one the player will initially spawn at, if multiple spawn points exist. + /// + public bool isDefault; } [JsonObject] diff --git a/NewHorizons/Handlers/PlanetCreationHandler.cs b/NewHorizons/Handlers/PlanetCreationHandler.cs index b32dda4e..7b7c1180 100644 --- a/NewHorizons/Handlers/PlanetCreationHandler.cs +++ b/NewHorizons/Handlers/PlanetCreationHandler.cs @@ -454,7 +454,11 @@ namespace NewHorizons.Handlers if (body.Config.Spawn != null) { Logger.LogVerbose("Making spawn point"); - Main.SystemDict[body.Config.starSystem].SpawnPoint = SpawnPointBuilder.Make(go, body.Config.Spawn, owRigidBody); + var spawnPoint = SpawnPointBuilder.Make(go, body.Config.Spawn, owRigidBody); + if (Main.SystemDict[body.Config.starSystem].SpawnPoint == null || (body.Config.Spawn.playerSpawn?.isDefault ?? false)) + { + Main.SystemDict[body.Config.starSystem].SpawnPoint = spawnPoint; + } } if (body.Config.Orbit.showOrbitLine && !body.Config.Orbit.isStatic)