-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Bug fixes - Fixes dying on spawn in Evacuation - Fixes the player seeing objects loading out when changing star system - Fixes a NRE on reload without the Stranger - No longer get burned by the sun when spawning in (for real this time) This time without introducing a bug that breaks systems with only a single planet!
- Loading branch information
Showing
9 changed files
with
66 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
NewHorizons/Components/PreserveActiveCenterOfTheUniverse.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using NewHorizons.Utility.OWML; | ||
using UnityEngine; | ||
|
||
namespace NewHorizons.Components | ||
{ | ||
// Prevents the center of the universe being deactivated | ||
public class PreserveActiveCenterOfTheUniverse : MonoBehaviour | ||
{ | ||
private GameObject _centerOfTheUniverse; | ||
|
||
public static void Apply(GameObject center) | ||
{ | ||
var go = new GameObject(nameof(PreserveActiveCenterOfTheUniverse)); | ||
go.AddComponent<PreserveActiveCenterOfTheUniverse>()._centerOfTheUniverse = center; | ||
} | ||
|
||
public void Update() | ||
{ | ||
if (!_centerOfTheUniverse.activeInHierarchy) | ||
{ | ||
NHLogger.LogWarning("Center of the universe cannot be inactive."); | ||
_centerOfTheUniverse.SetActive(true); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
NewHorizons/Patches/PlayerPatches/PlayerHazardDetectorPatches.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using HarmonyLib; | ||
using NewHorizons.Utility.OWML; | ||
|
||
namespace NewHorizons.Patches.PlayerPatches | ||
{ | ||
[HarmonyPatch(typeof(HazardDetector))] | ||
public static class PlayerHazardDetectorPatches | ||
{ | ||
[HarmonyPostfix] | ||
[HarmonyPatch(nameof(HazardDetector.Awake))] | ||
public static void HazardDetector_Awake(HazardDetector __instance) | ||
{ | ||
// Prevent the player detector from being hurt while the solar system is being set up | ||
if (__instance._isPlayerDetector && !Main.IsSystemReady) | ||
{ | ||
__instance.enabled = false; | ||
Delay.RunWhen(() => Main.IsSystemReady, () => __instance.enabled = true); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters