Make server handle requests which do not pull out a full stack kind of correctly

This commit is contained in:
osmarks 2018-04-30 20:48:47 +01:00
parent 4ed9b7ce58
commit b8a91eea86
1 changed files with 4 additions and 2 deletions

View File

@ -89,9 +89,11 @@ function processRequest(msg)
if msg.cmd == "extract" then
local inv, slot, item = search(msg)
index[inv][slot] = nil
local qty = msg.qty or 64
local moved = peripheral.call(conf.bufferOutInternal, "pullItems", inv, slot, msg.qty or 64, 1)
updateIndexFor(inv)
local moved = peripheral.call(conf.bufferOutInternal, "pullItems", inv, slot, qty, 1)
if msg.destInv then
moved = peripheral.call(conf.bufferOutExternal, "pushItems", msg.destInv, 1, 64, msg.destSlot)