From 778e0643e4e40ab00f2b298f6a2cb0f2f97c3329 Mon Sep 17 00:00:00 2001 From: osmarks Date: Fri, 27 Jul 2018 10:48:32 +0100 Subject: [PATCH] Update index after moving items. OOps. --- backend-chests.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend-chests.lua b/backend-chests.lua index 1317235..a52fffc 100644 --- a/backend-chests.lua +++ b/backend-chests.lua @@ -122,6 +122,9 @@ local function server(command) if quantity_missing > 0 then return w.errors.make(w.errors.NOITEMS, { type = w.get_internal_identifier(command), quantity = quantity_missing }) end local items_moved = fetch_by_location(first_available.location, command.quantity) + + update_index_for(first_available.location.inventory) -- I'm too lazy to manually update the item properly, and indexing is fast enough, so just do this + if command.destination_inventory then items_moved = peripheral.call(conf.buffer_external, "pushItems", command.destination_inventory, BUFFER_OUT_SLOT, command.quantity, command.destination_slot) end