aboutsummaryrefslogtreecommitdiff
path: root/advtrains_interlocking
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2020-06-16 16:11:35 +0200
committerorwell96 <orwell@bleipb.de>2021-02-10 16:36:24 +0100
commit114b915518190e112c7aa8f94a86f3e19660bd6e (patch)
tree176bf22c4d28c30bef8948e01601e0bb50dff1d1 /advtrains_interlocking
parent61329c11a28ca0d68f95f189d3a66c373d7dddc3 (diff)
downloadadvtrains-114b915518190e112c7aa8f94a86f3e19660bd6e.tar.gz
advtrains-114b915518190e112c7aa8f94a86f3e19660bd6e.tar.bz2
advtrains-114b915518190e112c7aa8f94a86f3e19660bd6e.zip
Fix new green signals bug caused by old trav_lzbdata, and callback loop in signalling formspec
Diffstat (limited to 'advtrains_interlocking')
-rw-r--r--advtrains_interlocking/tcb_ts_ui.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/advtrains_interlocking/tcb_ts_ui.lua b/advtrains_interlocking/tcb_ts_ui.lua
index da318a7..3952f91 100644
--- a/advtrains_interlocking/tcb_ts_ui.lua
+++ b/advtrains_interlocking/tcb_ts_ui.lua
@@ -558,7 +558,7 @@ local sig_pselidx = {}
-- Players having a signalling form open
local p_open_sig_form = {}
-function advtrains.interlocking.show_signalling_form(sigd, pname, sel_rte)
+function advtrains.interlocking.show_signalling_form(sigd, pname, sel_rte, called_from_form_update)
if not minetest.check_player_privs(pname, "train_operator") then
minetest.chat_send_player(pname, "Insufficient privileges to use this!")
return
@@ -651,7 +651,10 @@ function advtrains.interlocking.show_signalling_form(sigd, pname, sel_rte)
p_open_sig_form[pname] = sigd
-- always a good idea to update the signal aspect
- advtrains.interlocking.update_signal_aspect(tcbs)
+ if not called_from_form_update then
+ -- FIX prevent a callback loop
+ advtrains.interlocking.update_signal_aspect(tcbs)
+ end
end
function advtrains.interlocking.update_player_forms(sigd)
@@ -763,7 +766,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
tcbs.route_auto = false
end
- advtrains.interlocking.show_signalling_form(sigd, pname, sel_rte)
+ advtrains.interlocking.show_signalling_form(sigd, pname, sel_rte, true)
return
end