Fixes a bug where the ship wasn't removed from volumes when spawning

This commit is contained in:
Nick 2024-02-03 13:37:33 -05:00
parent d71dc6c22d
commit 61102e25eb
2 changed files with 15 additions and 1 deletions

View File

@ -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<ShipFluidDetector>()._activeVolumes)
{
if (volume.gameObject.activeInHierarchy)
{
volume.gameObject.SetActive(false);
volume.gameObject.SetActive(true);
}
}
}
}
else if (Main.Instance.CurrentStarSystem != "SolarSystem" && !Main.Instance.IsWarpingFromShip)

View File

@ -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" ],