summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeija <norrepli@gmail.com>2013-02-10 23:08:59 +0100
committerJeija <norrepli@gmail.com>2013-02-10 23:10:22 +0100
commit591e2d7cde9eda88ca85b71066dd9ed7f75f9a12 (patch)
treedaa8578f6efc2477014e6bbcd213bdbc92e155af
parent59cd72191b89e15dfd901dde487c6eb13252c3ba (diff)
downloadmesecons-591e2d7cde9eda88ca85b71066dd9ed7f75f9a12.tar
mesecons-591e2d7cde9eda88ca85b71066dd9ed7f75f9a12.tar.gz
mesecons-591e2d7cde9eda88ca85b71066dd9ed7f75f9a12.tar.bz2
mesecons-591e2d7cde9eda88ca85b71066dd9ed7f75f9a12.tar.xz
mesecons-591e2d7cde9eda88ca85b71066dd9ed7f75f9a12.zip
LuaController: Queue setting the ports (wait for pending operations)
-rw-r--r--mesecons_luacontroller/init.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/mesecons_luacontroller/init.lua b/mesecons_luacontroller/init.lua
index 344e0d3..91551a1 100644
--- a/mesecons_luacontroller/init.lua
+++ b/mesecons_luacontroller/init.lua
@@ -101,6 +101,10 @@ local action = function (pos, ports, forcereset)
end
end
+local delayedaction = function (params)
+ action(params.pos, params.ports)
+end
+
--------------------
-- Overheat stuff --
--------------------
@@ -273,7 +277,7 @@ lc_update = function (pos, event)
save_memory(meta, mem)
-- Actually set the ports
- action(pos, env.port)
+ minetest.after(0, delayedaction, {pos = pos, ports = env.port})
end
local reset_meta = function(pos, code, errmsg)