From fd3c5975eb23edcccaada915c894786692790dc8 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Sat, 23 Mar 2024 14:38:11 -0700 Subject: [PATCH 1/3] move cull fix above FixSectoredComponent or else it nres --- NewHorizons/Builder/Props/DetailBuilder.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/NewHorizons/Builder/Props/DetailBuilder.cs b/NewHorizons/Builder/Props/DetailBuilder.cs index 7e1bb581..6a05cb09 100644 --- a/NewHorizons/Builder/Props/DetailBuilder.cs +++ b/NewHorizons/Builder/Props/DetailBuilder.cs @@ -140,16 +140,16 @@ namespace NewHorizons.Builder.Props } else { - FixSectoredComponent(component, sector, existingSectors); - } + // Fix cull groups only when not from an asset bundle (because then they're there on purpose!) + // keepLoaded should remove existing groups + // renderers/colliders get enabled later so we dont have to do that here + if (detail.keepLoaded && !isFromAssetBundle && component is SectorCullGroup or SectorCollisionGroup or SectorLightsCullGroup) + { + UnityEngine.Object.DestroyImmediate(component); + continue; + } - // Fix cull groups only when not from an asset bundle (because then they're there on purpose!) - // keepLoaded should remove existing groups - // renderers/colliders get enabled later so we dont have to do that here - if (detail.keepLoaded && !isFromAssetBundle && component is SectorCullGroup or SectorCollisionGroup or SectorLightsCullGroup) - { - UnityEngine.Object.DestroyImmediate(component); - continue; + FixSectoredComponent(component, sector, existingSectors); } // Asset bundle is a real string -> Object loaded from unity From 581f7072799900daef4bc7713b04e29260549b7b Mon Sep 17 00:00:00 2001 From: Nick Date: Sat, 23 Mar 2024 17:51:57 -0400 Subject: [PATCH 2/3] Fix phanton shuttle --- .../Builder/Atmosphere/SunOverrideBuilder.cs | 1 + .../VolumePatches/DestructionVolumePatches.cs | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/NewHorizons/Builder/Atmosphere/SunOverrideBuilder.cs b/NewHorizons/Builder/Atmosphere/SunOverrideBuilder.cs index df696f4d..9ee0e365 100644 --- a/NewHorizons/Builder/Atmosphere/SunOverrideBuilder.cs +++ b/NewHorizons/Builder/Atmosphere/SunOverrideBuilder.cs @@ -1,6 +1,7 @@ using NewHorizons.External.Modules; using NewHorizons.External.Modules.VariableSize; using UnityEngine; + namespace NewHorizons.Builder.Atmosphere { public static class SunOverrideBuilder diff --git a/NewHorizons/Patches/VolumePatches/DestructionVolumePatches.cs b/NewHorizons/Patches/VolumePatches/DestructionVolumePatches.cs index 0dd86a57..3091d1fd 100644 --- a/NewHorizons/Patches/VolumePatches/DestructionVolumePatches.cs +++ b/NewHorizons/Patches/VolumePatches/DestructionVolumePatches.cs @@ -26,5 +26,25 @@ namespace NewHorizons.Patches.VolumePatches return false; } + + /// + /// This method detects Nomai shuttles that are inactive + /// When active, it swaps the position of the NomaiShuttleController and the Rigidbody, so its not found as a child here and explodes continuously forever + /// Just ignore the shuttle if its inactive + /// + [HarmonyPrefix] + [HarmonyPatch(nameof(DestructionVolume.VanishNomaiShuttle))] + public static bool DestructionVolume_VanishNomaiShuttle(DestructionVolume __instance, OWRigidbody shuttleBody, RelativeLocationData entryLocation) + { + if (shuttleBody.GetComponentInChildren() == null) + { + if (__instance._nomaiShuttleBody == shuttleBody) + { + __instance._nomaiShuttleBody = null; + } + return false; + } + return true; + } } } From 97391a0efc93d5753ecfb5aa3f4d317a66df9a80 Mon Sep 17 00:00:00 2001 From: Nick Date: Sat, 23 Mar 2024 17:52:09 -0400 Subject: [PATCH 3/3] Update manifest.json --- NewHorizons/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NewHorizons/manifest.json b/NewHorizons/manifest.json index a53790b2..1acb14fb 100644 --- a/NewHorizons/manifest.json +++ b/NewHorizons/manifest.json @@ -4,7 +4,7 @@ "author": "xen, Bwc9876, JohnCorby, MegaPiggy, Clay, Trifid, and friends", "name": "New Horizons", "uniqueName": "xen.NewHorizons", - "version": "1.19.5", + "version": "1.19.6", "owmlVersion": "2.10.3", "dependencies": [ "JohnCorby.VanillaFix", "xen.CommonCameraUtility", "dgarro.CustomShipLogModes" ], "conflicts": [ "Raicuparta.QuantumSpaceBuddies", "PacificEngine.OW_CommonResources" ],