From 61102e25ebec01b9ab69b2b09d0dff8ca877c5aa Mon Sep 17 00:00:00 2001 From: Nick Date: Sat, 3 Feb 2024 13:37:33 -0500 Subject: [PATCH] Fixes a bug where the ship wasn't removed from volumes when spawning --- NewHorizons/Handlers/PlayerSpawnHandler.cs | 14 ++++++++++++++ NewHorizons/manifest.json | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/NewHorizons/Handlers/PlayerSpawnHandler.cs b/NewHorizons/Handlers/PlayerSpawnHandler.cs index 2b32cd69..4b665cbb 100644 --- a/NewHorizons/Handlers/PlayerSpawnHandler.cs +++ b/NewHorizons/Handlers/PlayerSpawnHandler.cs @@ -77,6 +77,20 @@ namespace NewHorizons.Handlers } SpawnBody(ship.GetAttachedOWRigidbody(), SpawnPointBuilder.ShipSpawn, pos); + + // Bug affecting mods with massive stars (8600m+ radius) + // TH has an orbital radius of 8600m, meaning the base game ship spawn ends up inside the star + // This places the ship into the star's fluid volumes (destruction volume and atmosphere) + // When the ship is teleported out, it doesn't update it's detected fluid volumes and gets affected by drag forever + // Can fix by turning the volumes off and on again + foreach (var volume in ship.GetComponentInChildren()._activeVolumes) + { + if (volume.gameObject.activeInHierarchy) + { + volume.gameObject.SetActive(false); + volume.gameObject.SetActive(true); + } + } } } else if (Main.Instance.CurrentStarSystem != "SolarSystem" && !Main.Instance.IsWarpingFromShip) diff --git a/NewHorizons/manifest.json b/NewHorizons/manifest.json index 30dd04ed..c75c1b1c 100644 --- a/NewHorizons/manifest.json +++ b/NewHorizons/manifest.json @@ -4,7 +4,7 @@ "author": "xen, Bwc9876, clay, MegaPiggy, John, Trifid, Hawkbar, Book", "name": "New Horizons", "uniqueName": "xen.NewHorizons", - "version": "1.18.3", + "version": "1.18.4", "owmlVersion": "2.9.8", "dependencies": [ "JohnCorby.VanillaFix", "_nebula.MenuFramework", "xen.CommonCameraUtility", "dgarro.CustomShipLogModes" ], "conflicts": [ "Raicuparta.QuantumSpaceBuddies", "PacificEngine.OW_CommonResources" ],