mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Fix issue where you autopilot to the sun when in DB
This commit is contained in:
parent
701f908798
commit
90cff5bfc2
@ -68,9 +68,12 @@ namespace NewHorizons.Tools
|
|||||||
|
|
||||||
public static bool CheckShipOutersideSolarSystem(PlayerState __instance, ref bool __result)
|
public static bool CheckShipOutersideSolarSystem(PlayerState __instance, ref bool __result)
|
||||||
{
|
{
|
||||||
|
if (PlayerState._inBrambleDimension) return false;
|
||||||
|
|
||||||
Transform sunTransform = Locator.GetSunTransform();
|
Transform sunTransform = Locator.GetSunTransform();
|
||||||
OWRigidbody shipBody = Locator.GetShipBody();
|
OWRigidbody shipBody = Locator.GetShipBody();
|
||||||
__result = sunTransform != null && shipBody != null && (sunTransform.position - shipBody.transform.position).sqrMagnitude > Main.FurthestOrbit * Main.FurthestOrbit * 4f;
|
var maxDist2 = Mathf.Max(900000000f, Main.FurthestOrbit * Main.FurthestOrbit * 2f);
|
||||||
|
__result = sunTransform != null && shipBody != null && (sunTransform.position - shipBody.transform.position).sqrMagnitude > maxDist2;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user