Beispiel #1
0
        void OnVesselSituationChange(GameEvents.HostedFromToAction <Vessel, Vessel.Situations> change)
        {
            bool shouldReinitialise = false;

            if (change.from == Vessel.Situations.DOCKED)
            {
                shouldReinitialise = true;
            }

            if (change.to == Vessel.Situations.DOCKED)
            {
                shouldReinitialise = true;
            }

            if (shouldReinitialise)
            {
                ORSHelper.removeVesselFromCache(change.host);

                Debug.Log("[KSP Interstellar] GameEventSubscriber - OnVesselSituationChange reinitialising");

                var generators = change.host.FindPartModulesImplementing <FNGenerator>();

                generators.ForEach(g => g.OnStart(PartModule.StartState.Docked));

                var radiators = change.host.FindPartModulesImplementing <FNRadiator>();

                radiators.ForEach(g => g.OnStart(PartModule.StartState.Docked));
            }
        }