To be more specific I changed this:
scrap_3.unit.ingredients[5] = nil
scrap_2.unit.ingredients[4] = nil
scrap_1.unit.ingredients[3] = nil
to this:
while #scrap_3.unit.ingredients > 4 do
table.remove(scrap_3.unit.ingredients)
end
while #scrap_2.unit.ingredients > 3 do
table.remove(scrap_2.unit.ingredients)
end
while #scrap_1.unit.ingredients > 2 do
table.remove(scrap_1.unit.ingredients)
end
Edit: Oh I forgot to mention that I tested only with Fulgora as a starter planet, not sure how it will work with other...