diff --git a/NewHorizons/Components/ShipLog/ShipLogStarChartMode.cs b/NewHorizons/Components/ShipLog/ShipLogStarChartMode.cs index cae4a4b9..a99ea18c 100644 --- a/NewHorizons/Components/ShipLog/ShipLogStarChartMode.cs +++ b/NewHorizons/Components/ShipLog/ShipLogStarChartMode.cs @@ -259,7 +259,7 @@ namespace NewHorizons.Components.ShipLog if (!name.Equals(uniqueID)) return name; // Else we return a default name - if (uniqueID.Equals("SolarSystem")) return "Hearthian System"; + if (uniqueID.Equals("SolarSystem")) return "The Outer Wilds"; var splitString = uniqueID.Split('.'); if (splitString.Length > 1) splitString = splitString.Skip(1).ToArray(); diff --git a/NewHorizons/Handlers/PlanetCreationHandler.cs b/NewHorizons/Handlers/PlanetCreationHandler.cs index 90fc4a8f..a0e9f4c3 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 { diff --git a/NewHorizons/Handlers/PlayerSpawnHandler.cs b/NewHorizons/Handlers/PlayerSpawnHandler.cs index 083eff3b..2b32cd69 100644 --- a/NewHorizons/Handlers/PlayerSpawnHandler.cs +++ b/NewHorizons/Handlers/PlayerSpawnHandler.cs @@ -51,24 +51,38 @@ namespace NewHorizons.Handlers // Ensures it has invoked everything and actually placed the player in the cloaking field #671 cloak._firstUpdate = true; } + + // Spawn ship + Delay.FireInNUpdates(SpawnShip, 30); } public static void SpawnShip() { var ship = SearchUtilities.Find("Ship_Body"); - if (ship != null) + + if (SpawnPointBuilder.ShipSpawn != null) { - ship.SetActive(true); + NHLogger.Log("Spawning player ship"); - var pos = SpawnPointBuilder.ShipSpawn.transform.position; - - // Move it up a bit more when aligning to surface - if (SpawnPointBuilder.ShipSpawnOffset != null) + if (ship != null) { - pos += SpawnPointBuilder.ShipSpawn.transform.TransformDirection(SpawnPointBuilder.ShipSpawnOffset); - } + ship.SetActive(true); - SpawnBody(ship.GetAttachedOWRigidbody(), SpawnPointBuilder.ShipSpawn, pos); + var pos = SpawnPointBuilder.ShipSpawn.transform.position; + + // Move it up a bit more when aligning to surface + if (SpawnPointBuilder.ShipSpawnOffset != null) + { + pos += SpawnPointBuilder.ShipSpawn.transform.TransformDirection(SpawnPointBuilder.ShipSpawnOffset); + } + + SpawnBody(ship.GetAttachedOWRigidbody(), SpawnPointBuilder.ShipSpawn, pos); + } + } + else if (Main.Instance.CurrentStarSystem != "SolarSystem" && !Main.Instance.IsWarpingFromShip) + { + NHLogger.Log("System has no ship spawn. Deactivating it."); + ship?.SetActive(false); } } @@ -81,20 +95,6 @@ namespace NewHorizons.Handlers } InvulnerabilityHandler.MakeInvulnerable(false); - - if (!Main.Instance.IsWarpingFromShip) - { - if (SpawnPointBuilder.ShipSpawn != null) - { - NHLogger.Log("Spawning player ship"); - SpawnShip(); - } - else - { - NHLogger.Log("System has no ship spawn. Deactivating it."); - SearchUtilities.Find("Ship_Body")?.SetActive(false); - } - } } private static void FixPlayerVelocity()