Ejemplo n.º 1
0
        public static void updateRCSFuelType(FuelTypeISP fuelType, Part part, int rcsModuleIndex)
        {
            if (rcsModuleIndex < 0)
            {
                return;
            }
            ModuleRCS[] modules = part.GetComponents <ModuleRCS>();
            int         len     = modules.Length;

            if (rcsModuleIndex < len)
            {
                ModuleRCS rcsModule = modules[rcsModuleIndex];
                rcsModule.propellants.Clear();
                ConfigNode pNode = fuelType.fuelPreset.getPropellantNode(ResourceFlowMode.ALL_VESSEL_BALANCE);
                if (fuelType.atmosphereCurve != null)
                {
                    pNode.AddNode("atmosphereCurve", fuelType.atmosphereCurve.getNode("atmosphereCurve"));
                }
                rcsModule.OnLoad(pNode);
            }
            else
            {
                SSTULog.error("Could not update fuel type - ModuleRCS could not be found for index: " + rcsModuleIndex + "  There are not enough modules present in the part: " + len);
            }
        }
Ejemplo n.º 2
0
        private void updateRCSFuelType()
        {
            if (!updateFuel)
            {
                return;
            }
            ModuleRCS rcsModule = part.GetComponent <ModuleRCS>();

            if (rcsModule != null)
            {
                rcsModule.propellants.Clear();
                ConfigNode pNode = fuelType.getPropellantNode(ResourceFlowMode.ALL_VESSEL_BALANCE);
                rcsModule.OnLoad(pNode);
            }
        }