예제 #1
0
 private bool ProcessEjection(Part fromPart)
 {
     kerbalEVA = FlightEVA.fetch.spawnEVA(crew, fromPart, fromPart.airlock, true);
     if (kerbalEVA != null && kerbalEVA.vessel != null)
     {
         CameraManager.Instance.SetCameraFlight();
         if (crew != null && crew.KerbalRef != null)
         {
             crew.KerbalRef.state = Kerbal.States.BAILED_OUT;
             fromPart.vessel.RemoveCrew(crew);
         }
         if (BDArmorySettings.DRAW_DEBUG_LABELS)
         {
             Debug.Log("[BDArmory.KerbalSafety]: " + kerbalName + " ejected from " + fromPart.vessel.vesselName + " at " + fromPart.vessel.radarAltitude.ToString("0.00") + "m with velocity " + fromPart.vessel.Velocity().magnitude.ToString("0.00") + "m/s (vertical: " + fromPart.vessel.verticalSpeed + $")");
         }
         kerbalEVA.autoGrabLadderOnStart = false; // Don't grab the vessel.
         kerbalEVA.StartNonCollidePeriod(5f, 1f, fromPart, fromPart.airlock);
         KerbalSafetyManager.Instance.ManageNewlyEjectedKerbal(kerbalEVA, fromPart.vessel.Velocity());
         recovered = true;
         OnDestroy();
         return(true);
     }
     else
     {
         return(false);
     }
 }