From 1fdabad96e35909fcdd8dda553bf8f664c5f542f Mon Sep 17 00:00:00 2001 From: Dale McCoy <21223975+DaleStan@users.noreply.github.com> Date: Wed, 19 Feb 2025 15:13:03 -0500 Subject: [PATCH] fix(#419): Products after a fluid did not link correctly. --- Yafc.Model/Model/ProductionTableContent.cs | 7 +++---- changelog.txt | 5 +++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Yafc.Model/Model/ProductionTableContent.cs b/Yafc.Model/Model/ProductionTableContent.cs index eebc4fb4..f15ddf61 100644 --- a/Yafc.Model/Model/ProductionTableContent.cs +++ b/Yafc.Model/Model/ProductionTableContent.cs @@ -461,7 +461,6 @@ IEnumerable @internal() { private IEnumerable BuildProducts(bool forSolver) { float factor = forSolver ? 1 : (float)recipesPerSecond; // recipesPerSecond can be 0 when running the solver, which would create useless results. - int i = 0; IObjectWithQuality? spentFuel = fuel.FuelResult(); bool handledFuel = spentFuel == null || forSolver; // If we're running the solver or there's no spent fuel, it's already handled. @@ -481,7 +480,9 @@ private IEnumerable BuildProducts(bool forSolver) { } } - foreach (Product product in recipe.target.products) { + for (int i = 0; i < recipe.target.products.Length; i++) { + Product product = recipe.target.products[i]; + if (hierarchyEnabled) { Quality quality = recipe.quality; float baseAmount = product.GetAmountPerRecipe(parameters.productivity); @@ -504,8 +505,6 @@ private IEnumerable BuildProducts(bool forSolver) { } quality = quality.nextQuality!; } - - i++; } } else { diff --git a/changelog.txt b/changelog.txt index 2cabf527..5a43bfaa 100644 --- a/changelog.txt +++ b/changelog.txt @@ -15,6 +15,11 @@ // Internal changes: // Changes to the code that do not affect the behavior of the program. ---------------------------------------------------------------------------------------------------------------------- +Version: +Date: + Fixes: + - (regression) Links for recipes with fluid outputs were not handled correctly. +---------------------------------------------------------------------------------------------------------------------- Version: 2.8.0 Date: February 19th 2025 Features: