mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Fix player burning when spawning
This commit is contained in:
parent
094f62e9cd
commit
25b3c422ee
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user