new-horizons/NewHorizons/Patches/MapPatches/PlaneOffsetMarkerPatches.cs
2023-10-19 19:09:29 -04:00

19 lines
723 B
C#

using HarmonyLib;
namespace NewHorizons.Patches.MapPatches;
[HarmonyPatch(typeof(PlaneOffsetMarker))]
internal class PlaneOffsetMarkerPatches
{
[HarmonyPrefix]
[HarmonyPatch(nameof(PlaneOffsetMarker.Update))]
public static bool PlaneOffsetMarker_Update(PlaneOffsetMarker __instance)
{
// It tracks the sun originally
// Too lazy to perfectly time it getting the right static ref transform so we'll just do this
// It disables itself if the ref frame is ever null so don't let it do that bc the ref frame is null when it starts
__instance._sunTransform = Locator._centerOfTheUniverse._staticReferenceFrame.transform;
return __instance._sunTransform != null;
}
}