Only kill sun if theres a sun!

This commit is contained in:
Nick 2023-10-18 17:22:59 -04:00
parent 7e2f911811
commit 0b10c6d0b5

View File

@ -16,13 +16,16 @@ namespace NewHorizons.Handlers
public static void RemoveStockPlanets()
{
// For some reason disabling planets immediately ruins the creation of everything else
// However, the sun breaks a lot of stuff sometimes (literally destroys it in its volumes I imagine)
// Eg, vision torch in Mindscapes
// TODO: Fix it better by disabling destruction volumes the first few frames maybe
// Until then
// I am become death, the destroyer of worlds
SearchUtilities.Find("Sun_Body").transform.position = Vector3.left * 1000000000f;
if (Main.Instance.CurrentStarSystem != "EyeOfTheUniverse")
{
// For some reason disabling planets immediately ruins the creation of everything else
// However, the sun breaks a lot of stuff sometimes (literally destroys it in its volumes I imagine)
// Eg, vision torch in Mindscapes
// TODO: Fix it better by disabling destruction volumes the first few frames maybe
// Until then
// I am become death, the destroyer of worlds
SearchUtilities.Find("Sun_Body").transform.position = Vector3.left * 1000000000f;
}
// Adapted from EOTS thanks corby
var toDisable = new List<GameObject>();