mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Fix sun proxy breaking
This commit is contained in:
parent
13c2b8badc
commit
e8d7307bb3
@ -201,7 +201,8 @@ namespace NewHorizons.Components.Stars
|
|||||||
transform.localPosition = Vector3.zero;
|
transform.localPosition = Vector3.zero;
|
||||||
|
|
||||||
// Some effects use Locator.GetSunTransform so hopefully its fine to change it
|
// Some effects use Locator.GetSunTransform so hopefully its fine to change it
|
||||||
Locator._sunTransform = transform;
|
// Use the root transform of the star because that's the default behaviour, breaks SunProxy is not (potentially others)
|
||||||
|
Locator._sunTransform = star.transform;
|
||||||
|
|
||||||
// TODO?: maybe also turn off star controller stuff (mainly proxy light) since idk if that can handle more than 1 being on
|
// TODO?: maybe also turn off star controller stuff (mainly proxy light) since idk if that can handle more than 1 being on
|
||||||
}
|
}
|
||||||
|
|||||||
19
NewHorizons/Patches/ProxyPatches/SunProxyPatches.cs
Normal file
19
NewHorizons/Patches/ProxyPatches/SunProxyPatches.cs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
using HarmonyLib;
|
||||||
|
using NewHorizons.Utility;
|
||||||
|
|
||||||
|
namespace NewHorizons.Patches.ProxyPatches
|
||||||
|
{
|
||||||
|
[HarmonyPatch(typeof(SunProxy))]
|
||||||
|
public static class SunProxyPatches
|
||||||
|
{
|
||||||
|
[HarmonyPostfix]
|
||||||
|
[HarmonyPatch(nameof(SunProxy.Start))]
|
||||||
|
public static void SunProxy_Start(SunProxy __instance)
|
||||||
|
{
|
||||||
|
// We mess with the Locator.GetSunTransform() value to switch it to other relevant stars since it's used for some other effects
|
||||||
|
// However if it's set to a different star when the SunProxy starts it breaks, so we double check it here
|
||||||
|
__instance._sunTransform = SearchUtilities.Find("Sun_Body").transform;
|
||||||
|
__instance._realSunController = __instance._sunTransform.GetComponent<SunController>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user