public void StarNavigation(PlayerMove_Sail __instance) { ModDebug.Assert(IsCurNavStar()); player = __instance.player; if (IsCurNavStar()) { PlanetData localPlanet = GameMain.localPlanet; if (localPlanet != null) { #if DEBUG ModDebug.Log("Leave Local Planet"); #endif VectorLF3 dir = (__instance.player.uPosition - localPlanet.uPosition).normalized; Sail.SetDir(__instance, dir); return; } else { if (DetermineArrive() && IsCloseToNearStar(__instance)) { #if DEBUG ModDebug.Log("StarNavigation Arrive"); #endif Arrive(); Warp.TryLeaveWarp(__instance); return; } else { LongDistanceNavigate(__instance); return; } } } else { Arrive(); #if DEBUG ModDebug.Error("StarNavigation - No Target"); #endif } }