aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--advtrains_interlocking/route_prog.lua2
-rw-r--r--advtrains_interlocking/signal_api.lua6
-rw-r--r--advtrains_interlocking/signal_aspect_ui.lua4
3 files changed, 9 insertions, 3 deletions
diff --git a/advtrains_interlocking/route_prog.lua b/advtrains_interlocking/route_prog.lua
index 3bdf6d6..71ebdf3 100644
--- a/advtrains_interlocking/route_prog.lua
+++ b/advtrains_interlocking/route_prog.lua
@@ -537,7 +537,7 @@ minetest.register_on_punchnode(function(pos, node, player, pointed_thing)
show_routing_form(pname, tcbpos)
advtrains.interlocking.visualize_route(rp.origin, rp.route, "prog_"..pname, rp.tmp_lcks, pname)
return
- elseif advtrains.interlocking.database.get_tcb(pos) then
+ elseif advtrains.interlocking.db.get_tcb(pos) then
-- the punched node itself is a TCB
show_routing_form(pname, pos)
advtrains.interlocking.visualize_route(rp.origin, rp.route, "prog_"..pname, rp.tmp_lcks, pname)
diff --git a/advtrains_interlocking/signal_api.lua b/advtrains_interlocking/signal_api.lua
index e92658d..f624f7a 100644
--- a/advtrains_interlocking/signal_api.lua
+++ b/advtrains_interlocking/signal_api.lua
@@ -462,7 +462,11 @@ function signal.after_dig(pos, oldnode, oldmetadata, player)
advtrains.interlocking.db.unassign_signal_for_tcbs(sigd)
minetest.chat_send_player(player:get_player_name(), "Signal has been unassigned. Name and routes are kept for reuse.")
end
- -- TODO clear influence point
+ -- clear influence point
+ local ipts,iconnid = advtrains.interlocking.db.get_ip_by_signalpos(pos)
+ if ipts then
+ advtrains.interlocking.db.clear_ip_signal(ipts, iconnid)
+ end
advtrains.interlocking.signal.unregister_aspect(pos)
end
diff --git a/advtrains_interlocking/signal_aspect_ui.lua b/advtrains_interlocking/signal_aspect_ui.lua
index d67572c..98a332a 100644
--- a/advtrains_interlocking/signal_aspect_ui.lua
+++ b/advtrains_interlocking/signal_aspect_ui.lua
@@ -247,7 +247,9 @@ minetest.register_on_punchnode(function(pos, node, player, pointed_thing)
ipmarker(pos, plconnid)
minetest.chat_send_player(pname, "Configuring Signal: Successfully set influence point")
-- Try to find a TCB ahead and auto assign this signal there
- try_auto_assign_to_tcb(signalpos, pos, plconnid, pname)
+ if advtrains.interlocking.signal.get_signal_cap_level(signalpos) >= 2 then
+ try_auto_assign_to_tcb(signalpos, pos, plconnid, pname)
+ end
else
minetest.chat_send_player(pname, "Configuring Signal: Influence point of another signal is already present!")
end