public override void Startup()
        {
            base.Startup();
            // We don't want this getting triggered as a random failure
            core.DisableFailure("TestFlightFailure_IgnitionFail");
            Part prefab = this.part.partInfo.partPrefab;

            foreach (PartModule pm in prefab.Modules)
            {
                TestFlightFailure_IgnitionFail modulePrefab = pm as TestFlightFailure_IgnitionFail;
                if (modulePrefab != null && modulePrefab.Configuration == configuration)
                {
                    if ((object)modulePrefab.baseIgnitionChance != null)
                    {
                        Log("IgnitionFail: Loading baseIgnitionChance from prefab");
                        baseIgnitionChance = modulePrefab.baseIgnitionChance;
                    }
                    if ((object)modulePrefab.pressureCurve != null)
                    {
                        Log("IgnitionFail: Loading pressureCurve from prefab");
                        pressureCurve = modulePrefab.pressureCurve;
                    }
                }
            }
        }
Beispiel #2
0
        public void Startup()
        {
            // We don't want this getting triggered as a random failure
            core.DisableFailure("TestFlightFailure_IgnitionFail");
            Part prefab = this.part.partInfo.partPrefab;

            foreach (PartModule pm in prefab.Modules)
            {
                TestFlightFailure_IgnitionFail modulePrefab = pm as TestFlightFailure_IgnitionFail;
                if (modulePrefab != null && modulePrefab.Configuration == configuration)
                {
                    ignitionFailureRate = modulePrefab.ignitionFailureRate;
                }
            }
            if (engineIndex > 0)
            {
                engine = new EngineModuleWrapper(this.part, engineIndex);
            }
            else
            {
                engine = new EngineModuleWrapper(this.part);
            }
        }