mirror of
https://github.com/minetest-mods/mesecons.git
synced 2024-12-25 18:00:19 +01:00
Fix luacontroller interrupts not working if no iid is supplied
This commit is contained in:
parent
fb695e9c1c
commit
f388dc475a
@ -160,7 +160,7 @@ local safe_serialize = function(value)
|
|||||||
return minetest.serialize(deep_copy(value))
|
return minetest.serialize(deep_copy(value))
|
||||||
end
|
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
|
-- There is no luacontroller anymore / it has been reprogrammed / replaced
|
||||||
if (minetest.get_meta(pos):get_int("luac_id") ~= luac_id) then return end
|
if (minetest.get_meta(pos):get_int("luac_id") ~= luac_id) then return end
|
||||||
lc_update(pos, {type="interrupt", iid = iid})
|
lc_update(pos, {type="interrupt", iid = iid})
|
||||||
@ -169,8 +169,8 @@ end)
|
|||||||
local getinterrupt = function(pos)
|
local getinterrupt = function(pos)
|
||||||
local interrupt = function (time, iid) -- iid = interrupt id
|
local interrupt = function (time, iid) -- iid = interrupt id
|
||||||
if type(time) ~= "number" then return end
|
if type(time) ~= "number" then return end
|
||||||
luac_id = minetest.get_meta(pos):get_int("luac_id")
|
local luac_id = minetest.get_meta(pos):get_int("luac_id")
|
||||||
mesecon.queue:add_action(pos, "lc_interrupt", {iid, luac_id}, time, iid, 1)
|
mesecon.queue:add_action(pos, "lc_interrupt", {luac_id, iid}, time, iid, 1)
|
||||||
end
|
end
|
||||||
return interrupt
|
return interrupt
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user