diff --git a/compacting-storage.lua b/compacting-storage.lua index 019ed84..93de513 100644 --- a/compacting-storage.lua +++ b/compacting-storage.lua @@ -122,7 +122,7 @@ function dist_to_num (dist) end function get_dist (item_type, items) - local dist = { nuggets: 0, ingots: 0, blocks: 0 } + local dist = { nuggets = 0, ingots = 0, blocks = 0 } for _, item in pairs(items) do local type, form = item.name:match".-:(%l-)_(%l*)" if type == item_type and dist[form] ~= nil then @@ -134,15 +134,15 @@ end function get_diff (dist1, dist2) return { - nuggets: dist1.nuggets - dist2.nuggets, - ingots: dist1.ingots - dist2.ingots, - blocks: dist1.blocks - dist2.blocks + nuggets = dist1.nuggets - dist2.nuggets, + ingots = dist1.ingots - dist2.ingots, + blocks = dist1.blocks - dist2.blocks } end function filter_clamp (diff, current_dist) -- reduce diff numbers to what can be crafted using current resources - local new_diff = { nuggets: 0, ingots: 0, blocks: 0 } + local new_diff = { nuggets = 0, ingots = 0, blocks = 0 } if diff.blocks > 0 then new_diff.blocks = math.min( diff.blocks,