private void BuildAndLaunchCraft()
{
// build craft
ShipConstruct nship = ShipConstruction.LoadShip(uis.craftfile);
Vector3 offset = nship.Parts[0].transform.localPosition;
nship.Parts[0].transform.Translate(-offset);
string landedAt = "External Launchpad";
string flag = uis.flagname;
Game state = FlightDriver.FlightStateCache;
VesselCrewManifest crew = new VesselCrewManifest ();
ShipConstruction.CreateBackup(nship);
ShipConstruction.PutShipToGround(nship, GetLanchTransform());
ShipConstruction.AssembleForLaunch(nship, landedAt, flag, state, crew);
Vessel vsl = FlightGlobals.Vessels[FlightGlobals.Vessels.Count - 1];
FlightGlobals.ForceSetActiveVessel(vsl);
vsl.Landed = false;
if (kethane_present && !DebugPad)
UseResources(vsl);
if (vessel.situation == Vessel.Situations.ORBITING) {
HackStruts(vsl);
uis.vesselInfo = new DockedVesselInfo();
uis.vesselInfo.name = vsl.vesselName;
uis.vesselInfo.vesselType = vsl.vesselType;
uis.vesselInfo.rootPartUId = vsl.rootPart.flightID;
vsl.rootPart.Couple(part);
FlightGlobals.ForceSetActiveVessel (vessel);
} else {
uis.timer = 3.0f;
uis.launchee = vsl;
}
Staging.beginFlight();
}