From 8b42df7e8d181b6cab62fb8c4c540d22d7456940 Mon Sep 17 00:00:00 2001 From: osmarks Date: Thu, 16 Aug 2018 08:06:01 +0100 Subject: [PATCH] typod, again --- backend-chests.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/backend-chests.lua b/backend-chests.lua index e77bfd1..fc28679 100644 --- a/backend-chests.lua +++ b/backend-chests.lua @@ -137,7 +137,7 @@ end local function update_slot(inv, slot, by) index[inv][slot].count = index[inv][slot].count - by if index[inv][slot].count == 0 then index[inv][slot] = nil - elseif index[inv][lot].count < 0 then os.queueEvent "reindex" error "Index inconsistency error." end + elseif index[inv][slot].count < 0 then os.queueEvent "reindex" error "Index inconsistency error." end end local function server(command) @@ -193,7 +193,9 @@ local function server(command) local moved = 0 for _, loc in pairs(space_locations) do - moved = moved + peripheral.call(conf.buffer_internal, "pushItems", loc.inventory, BUFFER_IN_SLOT, 64, loc.slot) -- push from buffer to free space + local moved_now = peripheral.call(conf.buffer_internal, "pushItems", loc.inventory, BUFFER_IN_SLOT, 64, loc.slot) -- push from buffer to free space + update_slot(loc.inventory, loc.slot, -moved_now) + moved = moved + moved_now end return { moved = moved }