compacting-storage.lua: yet another bugfix!

This commit is contained in:
Emerson Rosen-Jones 2025-11-17 20:47:19 -05:00
parent 22c744ec46
commit 6310e3f741

View file

@ -79,19 +79,19 @@ function craft_multiple (item_type, conversion_type, count)
end
function execute_crafts (item_type, crafts)
local form = "nuggets"
if crafts[form] > 0 then
local num_crafts = crafts.nuggets
if num_crafts > 0 then
print(("Crafting %s nuggets"):format(item_type))
craft_multiple(item_type, 4, num_crafts)
elseif crafts[form] < 0 then
elseif num_crafts < 0 then
print(("Crafting %s ingots"):format(item_type))
craft_multiple(item_type, 1, -num_crafts)
end
form = "blocks"
if crafts[form] > 0 then
num_crafts = crafts.blocks
if num_crafts > 0 then
print(("Crafting %s blocks"):format(item_type))
craft_multiple(item_type, 2, num_crafts)
elseif crafts[form] < 0 then
elseif num_crafts < 0 then
print(("Crafting %s ingots"):format(item_type))
craft_multiple(item_type, 3, -num_crafts)
end