Merge branch 'dev' into stellar-remnants

This commit is contained in:
Nick 2022-08-25 23:30:15 -04:00
commit 6da2425809
3 changed files with 3 additions and 63 deletions

View File

@ -201,10 +201,8 @@ namespace NewHorizons.Builder.Body
}
// Remove all collisions if there are any
foreach (var col in proxy.GetComponentsInChildren<Collider>())
{
GameObject.Destroy(col);
}
foreach (var col in proxy.GetComponentsInChildren<Collider>()) GameObject.Destroy(col);
foreach (var col in proxy.GetComponentsInChildren<OWCollider>()) GameObject.Destroy(col);
foreach (var renderer in proxy.GetComponentsInChildren<Renderer>())
{

View File

@ -11,65 +11,6 @@ namespace NewHorizons.Patches
[HarmonyPatch]
public static class ProxyBodyPatches
{
[HarmonyPrefix]
[HarmonyPatch(typeof(ProxyBody), nameof(ProxyBody.Awake))]
public static void ProxyBody_Awake(ProxyBody __instance)
{
// Mobius rly used the wrong event name
GlobalMessenger.AddListener("EnterMapView", __instance.OnEnterMapView);
GlobalMessenger.AddListener("ExitMapView", __instance.OnExitMapView);
}
[HarmonyPrefix]
[HarmonyPatch(typeof(ProxyBody), nameof(ProxyBody.OnDestroy))]
public static void ProxyBody_OnDestroy(ProxyBody __instance)
{
GlobalMessenger.RemoveListener("EnterMapView", __instance.OnEnterMapView);
GlobalMessenger.RemoveListener("ExitMapView", __instance.OnExitMapView);
}
[HarmonyPrefix]
[HarmonyPatch(typeof(ProxyBody), nameof(ProxyBody.OnEnterMapView))]
public static void ProxyBody_OnEnterMapView(ProxyBody __instance)
{
// Set this to false before the method sets the rendering to false so it matches
__instance._outOfRange = false;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(ProxyBody), nameof(ProxyBody.IsObjectInSupernova))]
public static bool ProxyBody_IsObjectInSupernova(ProxyBody __instance, ref bool __result)
{
if (__instance is NHProxy nh && nh.StarEvolutionControllers != null)
{
__result = false;
return false;
}
else
{
__result = SupernovaEffectHandler.IsPointInsideAnySupernova(__instance._realObjectTransform.position);
return false;
}
}
// Mobius why doesn't ProxyOrbiter inherit from ProxyBody
[HarmonyPrefix]
[HarmonyPatch(typeof(ProxyOrbiter), nameof(ProxyOrbiter.Awake))]
public static void ProxyOrbiter_Awake(ProxyOrbiter __instance)
{
// Mobius rly used the wrong event name
GlobalMessenger.AddListener("EnterMapView", __instance.OnEnterMapView);
GlobalMessenger.AddListener("ExitMapView", __instance.OnExitMapView);
}
[HarmonyPrefix]
[HarmonyPatch(typeof(ProxyOrbiter), nameof(ProxyOrbiter.OnDestroy))]
public static void ProxyOrbiter_OnDestroy(ProxyOrbiter __instance)
{
GlobalMessenger.RemoveListener("EnterMapView", __instance.OnEnterMapView);
GlobalMessenger.RemoveListener("ExitMapView", __instance.OnExitMapView);
}
[HarmonyReversePatch]
[HarmonyPatch(typeof(ProxyPlanet), nameof(ProxyPlanet.Initialize))]
[MethodImpl(MethodImplOptions.NoInlining)]

View File

@ -6,6 +6,7 @@
"uniqueName": "xen.NewHorizons",
"version": "1.5.0",
"owmlVersion": "2.6.0",
"dependencies": [ "JohnCorby.VanillaFix" ],
"conflicts": [ "Raicuparta.QuantumSpaceBuddies", "PacificEngine.OW_Randomizer" ],
"pathsToPreserve": [ "planets", "systems", "translations" ]
}