diff --git a/1.6/1.6/Assemblies/ArachnaeSwarm.dll b/1.6/1.6/Assemblies/ArachnaeSwarm.dll index d3de441..df589aa 100644 Binary files a/1.6/1.6/Assemblies/ArachnaeSwarm.dll and b/1.6/1.6/Assemblies/ArachnaeSwarm.dll differ diff --git a/Source/ArachnaeSwarm/Building_Comps/CompNutritionToFuelConverter.cs b/Source/ArachnaeSwarm/Building_Comps/CompNutritionToFuelConverter.cs index e2da56b..1a60889 100644 --- a/Source/ArachnaeSwarm/Building_Comps/CompNutritionToFuelConverter.cs +++ b/Source/ArachnaeSwarm/Building_Comps/CompNutritionToFuelConverter.cs @@ -87,21 +87,20 @@ namespace ArachnaeSwarm if (workProgress >= Props.workAmount) { int unitsToCraft = (int)(workProgress / Props.workAmount); - float totalFuel = unitsToCraft * Props.fuelAmount; + float fuelToProduce = unitsToCraft * Props.fuelAmount; float spaceInTank = fuelComp.Props.fuelCapacity - fuelComp.Fuel; - if (totalFuel > spaceInTank) + if (spaceInTank > 0) { - totalFuel = spaceInTank; - unitsToCraft = (int)(totalFuel / Props.fuelAmount); - } + // Add as much fuel as possible, up to what was produced. + float fuelToAdd = System.Math.Min(fuelToProduce, spaceInTank); + fuelComp.Refuel(fuelToAdd); - if (unitsToCraft > 0) - { - fuelComp.Refuel(unitsToCraft * Props.fuelAmount); + // Consume the full cost, regardless of how much was actually added. nutritionProgress -= unitsToCraft * Props.nutritionCost; workProgress -= unitsToCraft * Props.workAmount; } + // If spaceInTank is 0, do nothing and let progress build up. } }