This is unimportant, so only address in your freetime. I'm still learning modding, and your script is very useful in learning more "unique" additions.
In your data-final-fixes.lua
, you replace the recipes of the circuits with their surrogate counterparts (or remove them if that option is not enabled). In your replacement function, you have this bit (Lines 33-45):
if ingredients[i][1] == "green-wire" or
ingredients[i][1] == "red-wire" then
if is_wire_surrogate then
ingredients[i][1] = "fake-" .. ingredients[i][1]
else
table.remove(ingredients, i)
end
elseif ingredients[i].name and (ingredients[i].name == "green-wire" or ingredients[i].name == "red-wire") then
if is_wire_surrogate then
ingredients[i].name = "fake-" .. ingredients[i].name
else
table.remove(ingredients, i)
end
-- and so on...
Why is it that you have this first part where you check ingredients[i][1]
? Is ingredients[i].name
not enough? Furthermore, as Lua scripts are typically 1-indexed, would ingredients[i][1]
not refer to the ingredients[i].type
parameter? From my naive impression, it seems unnecessary, but likely there's a reason for its inclusion and thus I was wondering your reasoning as I feel like I'm missing a crucial aspect here.
Thanks in advance for any help of this noobie modder.