Discard running interrupt and schedule events when LuaATC components are removed

This commit is contained in:
Maverick2797 2024-10-31 18:06:33 +08:00 committed by orwell
parent 715efe2293
commit 19d8e8c1a7
1 changed files with 4 additions and 0 deletions

View File

@ -55,6 +55,10 @@ end
function ac.after_dig_node(pos, node, player) function ac.after_dig_node(pos, node, player)
advtrains.invalidate_all_paths(pos) advtrains.invalidate_all_paths(pos)
advtrains.ndb.clear(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) local ph=minetest.pos_to_string(pos)
ac.nodes[ph]=nil ac.nodes[ph]=nil
end end