diff options
author | orwell96 <orwell@bleipb.de> | 2020-06-16 16:11:35 +0200 |
---|---|---|
committer | orwell96 <orwell@bleipb.de> | 2021-02-10 16:36:24 +0100 |
commit | 114b915518190e112c7aa8f94a86f3e19660bd6e (patch) | |
tree | 176bf22c4d28c30bef8948e01601e0bb50dff1d1 /advtrains_interlocking/tcb_ts_ui.lua | |
parent | 61329c11a28ca0d68f95f189d3a66c373d7dddc3 (diff) | |
download | advtrains-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/tcb_ts_ui.lua')
-rw-r--r-- | advtrains_interlocking/tcb_ts_ui.lua | 9 |
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 |