Skip to content

Commit

Permalink
Fixes a bug where the ship wasn't removed from volumes when spawning
Browse files Browse the repository at this point in the history
  • Loading branch information
xen-42 committed Feb 3, 2024
1 parent d71dc6c commit 61102e2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions NewHorizons/Handlers/PlayerSpawnHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,20 @@ public static void SpawnShip()
}

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)
Expand Down
2 changes: 1 addition & 1 deletion NewHorizons/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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" ],
Expand Down

0 comments on commit 61102e2

Please sign in to comment.