From d867cd723f373b0fc52bd2cdd19176a29598f8be Mon Sep 17 00:00:00 2001 From: orwell96 Date: Mon, 26 Aug 2019 20:46:08 +0200 Subject: Don't allow to remove TCB when a signal is assigned --- advtrains_interlocking/tcb_ts_ui.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'advtrains_interlocking') diff --git a/advtrains_interlocking/tcb_ts_ui.lua b/advtrains_interlocking/tcb_ts_ui.lua index dca50da..6c773ab 100644 --- a/advtrains_interlocking/tcb_ts_ui.lua +++ b/advtrains_interlocking/tcb_ts_ui.lua @@ -85,7 +85,7 @@ minetest.register_node("advtrains_interlocking:tcb_node", { local tcb = ildb.get_tcb(tcbpos) if not tcb then return true end for connid=1,2 do - if tcb[connid].ts_id then + if tcb[connid].ts_id or tcb[connid].signal then return false end end -- cgit v1.2.3 From 986c8fcf92925f8f36ea8957270eeff829b7abf1 Mon Sep 17 00:00:00 2001 From: orwell96 Date: Thu, 29 Aug 2019 21:11:27 +0200 Subject: Do not throw error when sync_tcb_neighbors fails --- advtrains_interlocking/database.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'advtrains_interlocking') diff --git a/advtrains_interlocking/database.lua b/advtrains_interlocking/database.lua index 7571a2c..8df874f 100644 --- a/advtrains_interlocking/database.lua +++ b/advtrains_interlocking/database.lua @@ -336,7 +336,8 @@ function ildb.sync_tcb_neighbors(pos, connid) local found_tcbs = { {p = pos, s = connid} } local node_ok, conns, rhe = advtrains.get_rail_info_at(pos, advtrains.all_tracktypes) if not node_ok then - error("update_tcb_neighbors but node is NOK: "..minetest.pos_to_string(pos)) + atwarn("update_tcb_neighbors but node is NOK: "..minetest.pos_to_string(pos)) + return end --atdebug("Traversing from ",pos, connid) -- cgit v1.2.3