The fix is to replace the GetItemFromRecipeResult function with:
-- check if recipe contains entry from Items
function GetItemFromRecipeResult(recipe)
if recipe.result and pole_names[recipe.result] then
return recipe.result
end
if recipe.normal and recipe.normal.result and pole_names[recipe.normal.result] then
return recipe.normal.result
end
if recipe.expensive and recipe.expensive.result and pole_names[recipe.expensive.result] then
return recipe.expensive.result
end
if recipe.results then
for , item in pairs(recipe.results) do
if (not item.type or item.type == "item") and (item.name and pole_names[item.name] or pole_names[item[1]]) then
return item.name or item[1]
end
end
end
if recipe.normal and recipe.normal.results then
for , item in pairs(recipe.normal.results) do
if (not item.type or item.type == "item") and (item.name and pole_names[item.name] or pole_names[item[1]]) then
return item.name or item[1]
end
end
end
if recipe.expensive and recipe.expensive.results then
for _, item in pairs(recipe.expensive.results) do
if (not item.type or item.type == "item") and (item.name and pole_names[item.name] or pole_names[item[1]]) then
return item.name or item[1]
end
end
end
return nil
end
Looks like the new version's code had some copy-pasted if statements from the new code, but didn't change the variable names in the loops to match them.