mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Fix #933 probably
This commit is contained in:
parent
36cbf67ff0
commit
95bd1f78e2
@ -8,6 +8,8 @@ namespace NewHorizons.Builder.General
|
|||||||
{
|
{
|
||||||
public static class AstroObjectBuilder
|
public static class AstroObjectBuilder
|
||||||
{
|
{
|
||||||
|
public static GameObject CenterOfUniverse { get; private set; }
|
||||||
|
|
||||||
public static NHAstroObject Make(GameObject body, AstroObject primaryBody, NewHorizonsBody nhBody, bool isVanilla)
|
public static NHAstroObject Make(GameObject body, AstroObject primaryBody, NewHorizonsBody nhBody, bool isVanilla)
|
||||||
{
|
{
|
||||||
NHAstroObject astroObject = body.AddComponent<NHAstroObject>();
|
NHAstroObject astroObject = body.AddComponent<NHAstroObject>();
|
||||||
@ -62,6 +64,8 @@ namespace NewHorizons.Builder.General
|
|||||||
|
|
||||||
if (config.Base.centerOfSolarSystem)
|
if (config.Base.centerOfSolarSystem)
|
||||||
{
|
{
|
||||||
|
CenterOfUniverse = body;
|
||||||
|
|
||||||
NHLogger.Log($"Setting center of universe to {config.name}");
|
NHLogger.Log($"Setting center of universe to {config.name}");
|
||||||
|
|
||||||
Delay.RunWhen(
|
Delay.RunWhen(
|
||||||
|
|||||||
@ -421,8 +421,8 @@ namespace NewHorizons.Handlers
|
|||||||
if (defaultPrimaryToSun)
|
if (defaultPrimaryToSun)
|
||||||
{
|
{
|
||||||
NHLogger.LogError($"Couldn't find {body.Config.Orbit.primaryBody}, defaulting to center of solar system");
|
NHLogger.LogError($"Couldn't find {body.Config.Orbit.primaryBody}, defaulting to center of solar system");
|
||||||
// TODO: Make this work in other systems. We tried using Locator.GetCenterOfUniverse before but that doesn't work since its too early now
|
// Fix #933 not defaulting primary body
|
||||||
primaryBody = SearchUtilities.Find("Sun_Body")?.GetComponent<AstroObject>();
|
primaryBody = (SearchUtilities.Find("Sun_Body") ?? AstroObjectBuilder.CenterOfUniverse)?.GetComponent<AstroObject>();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user