Stop interference again

This commit is contained in:
osmarks 2018-05-06 08:32:01 +01:00
parent 96ab565194
commit 63e5b5bfa2
3 changed files with 5 additions and 4 deletions

View File

@ -77,7 +77,8 @@ end
while true do
util.processMessage(function(m)
if m.cmd and m.item and m.cmd == "craft" then
return craft(m.item)
return true, craft(m.item)
end
return false
end)
end

View File

@ -137,7 +137,7 @@ function processRequests()
local ok, r = pcall(processRequest, msg)
if not ok then r = "ERROR" end
return r
return true, r
end)
end
end

View File

@ -106,8 +106,8 @@ local function split(str, sSeparator, nMax, bRegexp)
local function processMessage(f)
local id, msg = rednet.receive "dragon"
if msg and msg.uid then
local r = f(msg)
rednet.send(id, { uid = msg.uid, msg = r }, "dragon")
local send, response = f(msg)
if send then rednet.send(id, { uid = msg.uid, msg = response }, "dragon") end
end
end