Ejemplo n.º 1
0
        public void TryRestoreVessel(StoredVessel stored_vessel)
        {
            if (!can_restore())
            {
                return;
            }
            ScreenMessager.showMessage(string.Format("Launching {0}...", stored_vessel.vessel.vesselName), 3);
            //clean up
            stored_vessels.Remove(stored_vessel.vessel.vesselID);
            //switch hangar state
            hangar_state = HangarState.Inactive;
            //transfer resources
            transferResources(stored_vessel);
            //set restored vessel orbit
            GetLaunchTransform();
            position_vessel(stored_vessel);
            //restore vessel
            stored_vessel.Load();
            //get restored vessel from the world
            launched_vessel = stored_vessel.vessel.vesselRef;
            //transfer crew back to the launched vessel
            List <ProtoCrewMember> crew_to_transfer = CrewTransfer.delCrew(vessel, stored_vessel.crew);

            //change volume and mass
            change_part_params(stored_vessel.metric, -1f);
            //switch to restored vessel
            FlightGlobals.ForceSetActiveVessel(launched_vessel);
            SetupVessel(new LaunchedVessel(stored_vessel, launched_vessel, crew_to_transfer, part.flightID));
        }
Ejemplo n.º 2
0
 public void TryRestoreVessel(StoredVessel stored_vessel)
 {
     if(!can_restore()) return;
     ScreenMessager.showMessage(string.Format("Launching {0}...", stored_vessel.vessel.vesselName), 3);
     //clean up
     stored_vessels.Remove(stored_vessel.vessel.vesselID);
     //switch hangar state
     hangar_state = HangarState.Inactive;
     //transfer resources
     transferResources(stored_vessel);
     //set restored vessel orbit
     GetLaunchTransform();
     position_vessel(stored_vessel);
     //restore vessel
     stored_vessel.Load();
     //get restored vessel from the world
     launched_vessel = stored_vessel.vessel.vesselRef;
     //transfer crew back to the launched vessel
     List<ProtoCrewMember> crew_to_transfer = CrewTransfer.delCrew(vessel, stored_vessel.crew);
     //change volume and mass
     change_part_params(stored_vessel.metric, -1f);
     //switch to restored vessel
     FlightGlobals.ForceSetActiveVessel(launched_vessel);
     SetupVessel(new LaunchedVessel(stored_vessel, launched_vessel, crew_to_transfer, part.flightID));
 }