From c1cc8029ee26f25c5579de678c51fe748a8f3667 Mon Sep 17 00:00:00 2001 From: xen-42 Date: Wed, 30 Oct 2024 20:09:58 -0400 Subject: [PATCH] Move spawning to shared --- NewHorizons/Handlers/PlanetCreationHandler.cs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/NewHorizons/Handlers/PlanetCreationHandler.cs b/NewHorizons/Handlers/PlanetCreationHandler.cs index f0001677..60d3bded 100644 --- a/NewHorizons/Handlers/PlanetCreationHandler.cs +++ b/NewHorizons/Handlers/PlanetCreationHandler.cs @@ -510,13 +510,6 @@ namespace NewHorizons.Handlers // Have to do this after setting position var initialMotion = InitialMotionBuilder.Make(go, primaryBody, ao, owRigidBody, body.Config.Orbit); - // Spawning on other planets is a bit hacky so we do it last - if (body.Config.Spawn != null) - { - NHLogger.LogVerbose($"Making spawn point on {body.Config.name}"); - var spawnPoint = SpawnPointBuilder.Make(go, body.Config.Spawn, owRigidBody); - } - if (body.Config.Orbit.showOrbitLine && !body.Config.Orbit.isStatic) { OrbitlineBuilder.Make(body.Object, body.Config.Orbit.isMoon, body.Config); @@ -746,6 +739,12 @@ namespace NewHorizons.Handlers SupernovaEffectBuilder.Make(go, sector, body.Config, body.Mod, procGen, ambientLight, fog, atmosphere, null, fog?._fogImpostor); } + if (body.Config.Spawn != null) + { + NHLogger.LogVerbose($"Making spawn point on {body.Config.name}"); + SpawnPointBuilder.Make(go, body.Config.Spawn, rb); + } + // We allow removing children afterwards so you can also take bits off of the modules you used if (body.Config.removeChildren != null) RemoveChildren(go, body);