Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/BetterBurnTime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -316,14 +316,15 @@ private void GetThrustInfo(
for (int propellantIndex = 0; propellantIndex < engine.propellants.Count; ++propellantIndex)
{
Propellant propellant = engine.propellants[propellantIndex];
double density = PartResourceLibrary.Instance.GetDefinition(propellant.name).density;
if (!ShouldIgnore(propellant.name))
{
if (!availableResources.Has(propellant.name))
{
isStarved = true;
break;
}
ratioSum += propellant.ratio;
ratioSum += propellant.ratio * density;
}
}
if (isStarved) continue;
Expand All @@ -333,9 +334,10 @@ private void GetThrustInfo(
for (int propellantIndex = 0; propellantIndex < engine.propellants.Count; ++propellantIndex)
{
Propellant propellant = engine.propellants[propellantIndex];
double density = PartResourceLibrary.Instance.GetDefinition(propellant.name).density;
if (!ShouldIgnore(propellant.name))
{
double consumptionRate = ratio * propellant.ratio * engineTotalFuelConsumption; // tons/sec
double consumptionRate = ratio * propellant.ratio * density * engineTotalFuelConsumption; // tons/sec
propellantsConsumed.Add(propellant.name, consumptionRate);
}
}
Expand Down