Skip to content

Commit

Permalink
Fixed ModelCompute.prepareBlock
Browse files Browse the repository at this point in the history
Fixed linked matrix solved line with extra outputs doesn't automatically update #464
  • Loading branch information
Helfima committed Jul 6, 2023
1 parent 9cbf8b7 commit 148d6d7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Date: 2023-07-06
- Fixed crash while applying migration helmod_0.12.16.lua
- Fixed crash in onConfigurationChanged for scenario edit
- Fixed assembly limitation display turn off in logistic row and tooltip
- Fixed linked matrix solved line with extra outputs doesn't automatically update #464
---------------------------------------------------------------------------------------------------
Version: 0.12.16
Date: 2023-06-16
Expand Down
14 changes: 7 additions & 7 deletions data/ModelCompute.lua
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ function ModelCompute.update(model)
block.ingredients = {}
block.products = {}
else

---prepare bloc
ModelCompute.prepareBlock(block)

---state = 0 => produit
---state = 1 => produit pilotant
---state = 2 => produit restant
Expand All @@ -112,6 +116,7 @@ function ModelCompute.update(model)
if block.products == nil then
ModelCompute.computeBlock(block)
end

---prepare les inputs
local factor = -1
local block_elements = block.products
Expand All @@ -133,10 +138,6 @@ function ModelCompute.update(model)
end
end
end
---prepare bloc
local block_products, block_ingredients = ModelCompute.prepareBlock(block)
block.products = block_products
block.ingredients = block_ingredients

ModelCompute.computeBlockCleanInput(block)

Expand Down Expand Up @@ -201,8 +202,6 @@ end
-------------------------------------------------------------------------------
---Prepare production block
---@param block table
---@return table
---@return table
function ModelCompute.prepareBlock(block)
local recipes = block.recipes
if recipes ~= nil then
Expand Down Expand Up @@ -266,7 +265,8 @@ function ModelCompute.prepareBlock(block)
block_ingredient.state = 0
end
end
return block_products, block_ingredients
block.products = block_products
block.ingredients = block_ingredients
end
end

Expand Down
2 changes: 1 addition & 1 deletion info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "helmod",
"version": "0.12.16",
"version": "0.12.17",
"title": "Helmod: Assistant for planning your factory",
"author": "Helfima",
"contact": "Helfima",
Expand Down

0 comments on commit 148d6d7

Please sign in to comment.