Skip to content

Commit

Permalink
Fixed error ModelCompute.lua:244
Browse files Browse the repository at this point in the history
Fixed error ModelCompute.lua:244 after changer execution order of ModelCompute.prepareBlock
  • Loading branch information
Helfima committed Jul 9, 2023
1 parent 148d6d7 commit 6f2a655
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
---------------------------------------------------------------------------------------------------
Version: 0.12.18
Date: 2023-07-09
Bugfixes:
- Fixed error ModelCompute.lua:244 after changer execution order of ModelCompute.prepareBlock
---------------------------------------------------------------------------------------------------
Version: 0.12.17
Date: 2023-07-06
Bugfixes:
Expand Down
4 changes: 2 additions & 2 deletions data/ModelCompute.lua
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ function ModelCompute.prepareBlock(block)
for i, block_product in pairs(block_products) do
local product_key = Product(block_product):getTableKey()
---recopie la valeur input
if block.by_factory ~= true and block.products[product_key] ~= nil then
if block.by_factory ~= true and block.products ~= nil and block.products[product_key] ~= nil then
block_product.input = block.products[product_key].input
end
---pose le status
Expand All @@ -255,7 +255,7 @@ function ModelCompute.prepareBlock(block)
for i, block_ingredient in pairs(block_ingredients) do
local ingredient_key = Product(block_ingredient):getTableKey()
---recopie la valeur input
if block.by_factory ~= true and block.ingredients[ingredient_key] ~= nil then
if block.by_factory ~= true and block.ingredients ~= nil and block.ingredients[ingredient_key] ~= nil then
block_ingredient.input = block.ingredients[ingredient_key].input
end
---pose le status
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.17",
"version": "0.12.18",
"title": "Helmod: Assistant for planning your factory",
"author": "Helfima",
"contact": "Helfima",
Expand Down

0 comments on commit 6f2a655

Please sign in to comment.