Fix proxies but not really

This commit is contained in:
Nick 2023-08-25 23:47:26 -04:00
parent 5b2480c8fd
commit 9f2ff4b635
3 changed files with 8 additions and 6 deletions

View File

@ -49,9 +49,11 @@ namespace NewHorizons.Handlers
public static void RegisterVanillaProxyOrbiter(ProxyOrbiter proxy) public static void RegisterVanillaProxyOrbiter(ProxyOrbiter proxy)
{ {
if (proxy._originalPlanetBody != null) // The _originalBody is the moon
// For _originalPlanetBody, that game object will also have a ProxyBody on it so it'd be counted via the other cache
if (proxy._originalBody != null)
{ {
_vanillaProxyOrbiter.Add(proxy._originalPlanetBody, proxy); _vanillaProxyOrbiter.Add(proxy._originalBody, proxy);
} }
} }

View File

@ -7,8 +7,8 @@ namespace NewHorizons.Patches.ProxyPatches;
public static class ProxyBodyPatches public static class ProxyBodyPatches
{ {
[HarmonyPostfix] [HarmonyPostfix]
[HarmonyPatch(nameof(ProxyBody.Awake))] [HarmonyPatch(nameof(ProxyBody.LateInitialize))]
public static void ProxyBody_Awake(ProxyBody __instance) public static void ProxyBody_LateInitialize(ProxyBody __instance)
{ {
ProxyHandler.RegisterVanillaProxyBody(__instance); ProxyHandler.RegisterVanillaProxyBody(__instance);
} }

View File

@ -7,8 +7,8 @@ namespace NewHorizons.Patches.ProxyPatches;
public static class ProxyOrbiterPatches public static class ProxyOrbiterPatches
{ {
[HarmonyPostfix] [HarmonyPostfix]
[HarmonyPatch(nameof(ProxyOrbiter.Awake))] [HarmonyPatch(nameof(ProxyOrbiter.SetOriginalBodies))]
public static void ProxyOrbiter_Awake(ProxyOrbiter __instance) public static void ProxyOrbiter_SetOriginalBodies(ProxyOrbiter __instance)
{ {
ProxyHandler.RegisterVanillaProxyOrbiter(__instance); ProxyHandler.RegisterVanillaProxyOrbiter(__instance);
} }