From 19d8e8c1a7dc82fa0ca1f65f04936e22c8b6e2a7 Mon Sep 17 00:00:00 2001 From: Maverick2797 Date: Thu, 31 Oct 2024 18:06:33 +0800 Subject: Discard running interrupt and schedule events when LuaATC components are removed --- advtrains_luaautomation/active_common.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/advtrains_luaautomation/active_common.lua b/advtrains_luaautomation/active_common.lua index 1a7009f..074d3b3 100644 --- a/advtrains_luaautomation/active_common.lua +++ b/advtrains_luaautomation/active_common.lua @@ -55,6 +55,10 @@ end function ac.after_dig_node(pos, node, player) advtrains.invalidate_all_paths(pos) advtrains.ndb.clear(pos) + atlatc.interrupt.clear_ints_at_pos(pos) + if advtrains.lines and advtrains.lines.sched then + advtrains.lines.sched.discard_all(advtrains.encode_pos(pos)) + end local ph=minetest.pos_to_string(pos) ac.nodes[ph]=nil end -- cgit v1.2.3