Bug originally found in Space Exploration:
In some recipes, improved recipes use the original value for result amount instead of the calculated one
For instance, SE recipe for utility science pack has
original recipe: (1 solar panel and some ,ore) to (4 science packs, 4 junk cards, 100 thermofluid)
recipe level 1 (x5) is (5 solar panel and some ,ore) to (4,4,110)
while it obviously should be (22,22,110)
Found the problem: SE defines some recipe results as {"utility-science-pack", 4} instead of {amount = 4, name = "utility-science-pack"}
Here's a quick fix that seems to work (in recipe.lua line 154)
if check then
for a, b in pairs(CE_recipes[name][tostring(count)].results) do
if not b.amount and not b.amount_min then
local oldB=Deepcopy(b)
for i, v in ipairs(b) do b[i] = nil end
b.amount=oldB[2]
b.name=oldB[1]
log("Normalized recipe result: ".. serpent.line(oldB) .. " to " .. serpent.line(b))
end
I'm not familiar with LUA so there should be a much cleaner way to proceed :)
Also, for SE recipes that output heated coolant or junk data cards, there should be exclusions so that output is not multiplied: it wouldn't make sense taht an improved recipe provides more coolant that you input (also it would create a terrible mess in your fluids setup)