From b912593ed1c6e1ecc9ed8e3d312bc1109f0c447f Mon Sep 17 00:00:00 2001 From: Nick Date: Thu, 24 Aug 2023 14:35:34 -0400 Subject: [PATCH] Fix defaultPrimaryToSun --- NewHorizons/Handlers/PlanetCreationHandler.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/NewHorizons/Handlers/PlanetCreationHandler.cs b/NewHorizons/Handlers/PlanetCreationHandler.cs index 85e8dd3c..b80b6bf8 100644 --- a/NewHorizons/Handlers/PlanetCreationHandler.cs +++ b/NewHorizons/Handlers/PlanetCreationHandler.cs @@ -391,7 +391,8 @@ namespace NewHorizons.Handlers if (defaultPrimaryToSun) { NHLogger.LogError($"Couldn't find {body.Config.Orbit.primaryBody}, defaulting to center of solar system"); - primaryBody = Locator.GetCenterOfTheUniverse().GetAttachedOWRigidbody().GetComponent(); + // TODO: Make this work in other systems. We tried using Locator.GetCenterOfUniverse before but that doesn't work since its too early now + primaryBody = SearchUtilities.Find("Sun_Body")?.GetComponent(); } else {