Angel's Refining


Adds ore refining to the game. Compound ores have to be refined before you are able to smelt and cast them into plates. Works best in conjunction with Bobmods and supports additional mods like Yuoki Industries, Uranium Power and Nucular.

Content
8 months ago
0.14 - 1.1
205K
Mining

b Override Functions corner case

8 years ago
(updated 8 years ago)

There is a corner case not covered in the "adjust_subtable" that I only picked up because of a very old mod. For some reason the author decided to name the "amount" field but not the "item" field in the result tables. "adjust_subtable" only checks whether or not the "item" field is named and then assumes that the "amount" is the same. If the "amount" field is present when "adjust_subtable" assumes it isn't, Factorio crashes with an error about type conversion.

Changing the top if block in "adjust_subtable" to the following fixes the issue.

if not item.name then -- shift to uniform format for ease of handling
item.name = item[1]
item.type = "item"
item[1] = nil
end
if not item.amount then
item.amount = item[2]
item[2] = nil
end

No other mods that I am aware of specify their results tables this way so this shouldn't be critical to fix.