diff options
author | orwell <orwell@bleipb.de> | 2025-01-15 23:19:26 +0100 |
---|---|---|
committer | orwell <orwell@bleipb.de> | 2025-01-15 23:19:26 +0100 |
commit | a45a9e27197dc98952f4ada7842f49d81899ab07 (patch) | |
tree | e0446ebcab5720618dede4f9be44eeb432311484 /advtrains_interlocking | |
parent | e654a1fbe6c15cbf45c1d0c6760545db81deae48 (diff) | |
download | advtrains-a45a9e27197dc98952f4ada7842f49d81899ab07.tar.gz advtrains-a45a9e27197dc98952f4ada7842f49d81899ab07.tar.bz2 advtrains-a45a9e27197dc98952f4ada7842f49d81899ab07.zip |
Fix bugs found in the video
Diffstat (limited to 'advtrains_interlocking')
-rw-r--r-- | advtrains_interlocking/route_prog.lua | 2 | ||||
-rw-r--r-- | advtrains_interlocking/signal_api.lua | 6 | ||||
-rw-r--r-- | advtrains_interlocking/signal_aspect_ui.lua | 4 |
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 |