diff --git a/lignumis/changelog.txt b/lignumis/changelog.txt index 8d62e8a..548c709 100644 --- a/lignumis/changelog.txt +++ b/lignumis/changelog.txt @@ -1,4 +1,9 @@ --------------------------------------------------------------------------------------------------- +Version: 1.0.8 +Date: 04.02.2025 + Bug Fixes: + - Fix crash due to error `attempt to get length of local 'woodResults' (a nil value)` +--------------------------------------------------------------------------------------------------- Version: 1.0.7 Date: 04.02.2025 Changes: diff --git a/lignumis/info.json b/lignumis/info.json index 534380c..d2ab995 100644 --- a/lignumis/info.json +++ b/lignumis/info.json @@ -1,6 +1,6 @@ { "name": "lignumis", - "version": "1.0.7", + "version": "1.0.8", "title": "Lignumis", "description": "Dive into the world of Lignumis, a moon of Nauvis offering only the most basic technologies.", "author": "cackling fiend", diff --git a/lignumis/prototypes/integrations/vanilla.lua b/lignumis/prototypes/integrations/vanilla.lua index 3119f5f..a9e19dc 100644 --- a/lignumis/prototypes/integrations/vanilla.lua +++ b/lignumis/prototypes/integrations/vanilla.lua @@ -81,12 +81,12 @@ for _, tree in pairs(data.raw.tree) do end local minable = tree.minable local woodResults = minable.results and table.filter(minable.results, isWoodResult) - local isRegularTree = (minable.result == "wood" and minable.count == 4) or (#minable.results == 1 and #woodResults == 1 and woodResults[1].amount == 4) + local isRegularTree = (minable.result == "wood" and minable.count == 4) or (minable.results and #minable.results == 1 and #woodResults == 1 and woodResults[1].amount == 4) if not isRegularTree then goto continue end tree.minable.result = nil tree.minable.count = nil local woodResult = { type = "item", name = "wood", amount = nil, amount_min = 2, amount_max = 10 } - if #woodResults > 0 then + if minable.results and #woodResults > 0 then table.assign(woodResults[1], woodResult) else minable.results = { woodResult }