Skip to content
Permalink
Browse files

Fix luacontroller interrupts not working if no iid is supplied

  • Loading branch information
Jeija
Jeija committed Nov 23, 2014
1 parent fb695e9 commit f388dc475a1770151bd19208bfae7e204d5cde71
Showing with 3 additions and 3 deletions.
  1. +3 −3 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

0 comments on commit f388dc4

Please sign in to comment.
You can’t perform that action at this time.