Fix crash when there is a tree that has no minable property

This commit is contained in:
Simon Brodtmann 2025-05-30 21:48:47 +02:00
parent 415054ae2b
commit 81214f2a46

View file

@ -99,6 +99,7 @@ for _, tree in pairs(data.raw.tree) do
return result.name == "wood"
end
local minable = tree.minable
if not minable then goto continue end
local woodResults = minable.results and table.filter(minable.results, isWoodResult)
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