summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeija <jeija@mesecons.net>2014-11-23 10:59:51 +0100
committerJeija <jeija@mesecons.net>2014-11-23 10:59:51 +0100
commitf388dc475a1770151bd19208bfae7e204d5cde71 (patch)
tree456bcd8b6cf1788bafc3b0387000f451711e52ff
parentfb695e9c1cfa17f983d0c4c830b17061c5bfb3dd (diff)
downloadmesecons-f388dc475a1770151bd19208bfae7e204d5cde71.tar
mesecons-f388dc475a1770151bd19208bfae7e204d5cde71.tar.gz
mesecons-f388dc475a1770151bd19208bfae7e204d5cde71.tar.bz2
mesecons-f388dc475a1770151bd19208bfae7e204d5cde71.tar.xz
mesecons-f388dc475a1770151bd19208bfae7e204d5cde71.zip
Fix luacontroller interrupts not working if no iid is supplied
-rw-r--r--mesecons_luacontroller/init.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/mesecons_luacontroller/init.lua b/mesecons_luacontroller/init.lua
index 854e264..637b2e5 100644
--- a/mesecons_luacontroller/init.lua
+++ b/mesecons_luacontroller/init.lua
@@ -160,7 +160,7 @@ local safe_serialize = function(value)
return minetest.serialize(deep_copy(value))
end
-mesecon.queue:add_function("lc_interrupt", function (pos, iid, luac_id)
+mesecon.queue:add_function("lc_interrupt", function (pos, luac_id, iid)
-- There is no luacontroller anymore / it has been reprogrammed / replaced
if (minetest.get_meta(pos):get_int("luac_id") ~= luac_id) then return end
lc_update(pos, {type="interrupt", iid = iid})
@@ -169,8 +169,8 @@ end)
local getinterrupt = function(pos)
local interrupt = function (time, iid) -- iid = interrupt id
if type(time) ~= "number" then return end
- luac_id = minetest.get_meta(pos):get_int("luac_id")
- mesecon.queue:add_action(pos, "lc_interrupt", {iid, luac_id}, time, iid, 1)
+ local luac_id = minetest.get_meta(pos):get_int("luac_id")
+ mesecon.queue:add_action(pos, "lc_interrupt", {luac_id, iid}, time, iid, 1)
end
return interrupt
end