public virtual void BackHomeDrive() { List <CelestialBody> Bodies = FlightGlobals.Bodies; ScreenMessages.PostScreenMessage("[BMSHyperdrive]: starting.Jumping to body: " + Bodies[1] + ".", 5, ScreenMessageStyle.UPPER_CENTER); WarpDriver.LowTechWarp(Bodies[1], 23000); }
public virtual void BMSHyperdrive() { try { float RandomLimitValue = (PlanetCount + 1); print("[BMSHyperdrive]: Bodies loaded. Number of bodies: " + PlanetCount + "."); if (Bodies[TargetFGI] != null) { print(Utils.Log("starting. Jumping to body: " + Bodies[TargetFGI] + ".")); ScreenMessages.PostScreenMessage(Utils.Log("starting.Jumping to body: " + Bodies[TargetFGI] + "."), 5, ScreenMessageStyle.UPPER_CENTER); WarpDriver.LowTechWarp(Bodies[TargetFGI], timeError); } else { Debug.LogError("Exception: List " + Bodies + "Contains no instance of an object with type CelestialBody at list place " + TargetFGI + "."); ScreenMessages.PostScreenMessage("Sorry, the BMSHyperdrive cannot jump to that location. We also cannot open the pod bay doors. Blame the engineers.", 5, ScreenMessageStyle.UPPER_CENTER); throw new NullReferenceException(); return; } } catch (NullReferenceException nre) { Debug.LogError(nre.Message); Debug.LogError("List " + Bodies + "Contains no instance of an object with type CelestialBody at list place " + TargetFGI + "."); } }