From cce18737d2328db68bb6eb5b82305802307ff11f Mon Sep 17 00:00:00 2001 From: Emerson Rosen-Jones Date: Mon, 17 Nov 2025 19:18:23 -0500 Subject: [PATCH] compacting-storage.lua: I forgot how table constructors work --- compacting-storage.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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,