diff options
Diffstat (limited to 'advtrains/advtrains_luaautomation/active_common.lua')
-rw-r--r-- | advtrains/advtrains_luaautomation/active_common.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/advtrains/advtrains_luaautomation/active_common.lua b/advtrains/advtrains_luaautomation/active_common.lua index b94a260..474838e 100644 --- a/advtrains/advtrains_luaautomation/active_common.lua +++ b/advtrains/advtrains_luaautomation/active_common.lua @@ -84,7 +84,7 @@ function ac.on_receive_fields(pos, formname, fields, player) end end -function ac.run_in_env(pos, evtdata, customfct) +function ac.run_in_env(pos, evtdata, customfct_p) local ph=minetest.hash_node_position(pos) local nodetbl = ac.nodes[ph] or {} @@ -100,6 +100,11 @@ function ac.run_in_env(pos, evtdata, customfct) return false, "No code to run!" end + local customfct=customfct_p or {} + customfct.interrupt=function(t, imesg) + atlatc.interrupt.add(t, pos, {type="int", int=true, message=imesg}) + end + local datain=nodetbl.data or {} local succ, dataout = atlatc.envs[nodetbl.env]:execute_code(datain, nodetbl.code, evtdata, customfct) if succ then |