Exemple #1
0
        public override void OnUpdate()
        {
            if (part.protoModuleCrew.Count > 0)
            {
                List <ModuleKrCrewCompartment> clist = ModuleKrCrewCompartment.GetCompartments(vessel);
                foreach (ModuleKrCrewCompartment c in clist)
                {
                    if (c.HasFreeSeat)
                    {
                        ProtoCrewMember cmember = part.protoModuleCrew[0];
                        part.RemoveCrewmember(cmember);
                        c.part.AddCrewmember(cmember);
                        vessel.SpawnCrew();
                        break;
                    }
                }
            }

            if (vessel.isActiveVessel)
            {
                part.CrewCapacity = 1;
            }
            else
            {
                part.CrewCapacity = ModuleKrCrewCompartment.GetCompartments(vessel).Any(c => c.HasFreeSeat) ? 1 : 0;
            }
        }
Exemple #2
0
        public void StartEVA()
        {
            ModuleKrCrewCompartment c = ModuleKrCrewCompartment.GetCompartments(vessel).FirstOrDefault(x => x.part.protoModuleCrew.Count > 0);

            if (c == null)
            {
                ScreenMessages.PostScreenMessage("No crew compartment with crew found", 3, ScreenMessageStyle.UPPER_CENTER);
            }
            else
            {
                ProtoCrewMember m = c.part.protoModuleCrew[0];
                c.part.RemoveCrewmember(m);
                part.AddCrewmember(m);
                FlightEVA.fetch.spawnEVA(m, part, part.airlock);
            }
        }