diff --git a/Source/Tanks/FuelInfo.cs b/Source/Tanks/FuelInfo.cs index 2339f47a..79efe36d 100644 --- a/Source/Tanks/FuelInfo.cs +++ b/Source/Tanks/FuelInfo.cs @@ -13,6 +13,7 @@ internal class FuelInfo { public string names; public readonly List propellants; + public readonly List volumeMults; public readonly double efficiency; public readonly double ratioFactor; @@ -26,12 +27,13 @@ public string Label { get { string label = ""; - foreach (Propellant tfuel in propellants) { + for (int i = 0; i < propellants.Count; ++i) { + Propellant tfuel = propellants[i]; if (PartResourceLibrary.Instance.GetDefinition (tfuel.name).resourceTransferMode != ResourceTransferMode.NONE && !IgnoreFuel (tfuel.name)) { if (label.Length > 0) { label += " / "; } - label += Math.Round (100000 * tfuel.ratio / efficiency, 0)*0.001 + "% " + tfuel.name; + label += Math.Round (100000 * tfuel.ratio * volumeMults[i] / efficiency, 0)*0.001 + "% " + tfuel.name; } } return label; @@ -47,8 +49,10 @@ public FuelInfo (List props, ModuleFuelTanks tank, string title) ratioFactor = 0.0; efficiency = 0.0; propellants = props; + volumeMults = new List(props.Count); - foreach (Propellant tfuel in propellants) { + for (int i = 0; i < propellants.Count; ++i) { + Propellant tfuel = propellants[i]; if (PartResourceLibrary.Instance.GetDefinition (tfuel.name) == null) { Debug.LogError ("Unknown RESOURCE {" + tfuel.name + "}"); ratioFactor = 0.0; @@ -57,8 +61,10 @@ public FuelInfo (List props, ModuleFuelTanks tank, string title) if (PartResourceLibrary.Instance.GetDefinition (tfuel.name).resourceTransferMode != ResourceTransferMode.NONE) { FuelTank t; if (tank.tankList.TryGet (tfuel.name, out t)) { - efficiency += tfuel.ratio/t.utilization; + double volumeMultiplier = 1d / t.utilization; + efficiency += tfuel.ratio * volumeMultiplier; ratioFactor += tfuel.ratio; + volumeMults.Add(volumeMultiplier); } else if (!IgnoreFuel (tfuel.name)) { ratioFactor = 0.0; break;