diff options
Diffstat (limited to 'advtrains_interlocking')
-rw-r--r-- | advtrains_interlocking/route_prog.lua | 7 | ||||
-rw-r--r-- | advtrains_interlocking/routesetting.lua | 6 | ||||
-rw-r--r-- | advtrains_interlocking/tcb_ts_ui.lua | 6 |
3 files changed, 11 insertions, 8 deletions
diff --git a/advtrains_interlocking/route_prog.lua b/advtrains_interlocking/route_prog.lua index 15c2b6b..498df5f 100644 --- a/advtrains_interlocking/route_prog.lua +++ b/advtrains_interlocking/route_prog.lua @@ -320,12 +320,13 @@ minetest.register_chatcommand("at_rp_back", return advtrains.pcall(function() local rp = player_rte_prog[pname] if rp then - if #rp.route.tcbpath <= 0 then + if #rp.route <= 0 then return false, "Cannot backtrack when there are no route elements" end - rp.route.tcbpath[#rp.route.tcbpath] = nil + rp.tmp_locks = rp.route[#rp.route].locks + rp.route[#rp.route] = nil advtrains.interlocking.visualize_route(rp.origin, rp.route, "prog_"..pname) - return true, "Route section "..(#rp.route.tcbpath+1).." removed." + return true, "Route section "..(#rp.route+1).." removed." end return false, "You are not programming a route!" end) diff --git a/advtrains_interlocking/routesetting.lua b/advtrains_interlocking/routesetting.lua index bfcfee7..5947555 100644 --- a/advtrains_interlocking/routesetting.lua +++ b/advtrains_interlocking/routesetting.lua @@ -84,7 +84,7 @@ function ilrs.set_route(signal, route, try) if not try then atwarn("Encountered route lock while a real run of routesetting routine, at position",pts,"while setting route",rtename,"of",signal) end return false, "Lock conflict at "..pts..", Held locked by:\n"..confl, nil, pts elseif not try then - ndef.luaautomation.setstate(pos, state) + ndef.luaautomation.setstate(pos, node, state) end end if not try then @@ -181,7 +181,9 @@ function ilrs.free_route_locks_indiv(pts, ts, nocallbacks) end -- This must be delayed, because this code is executed in-between a train step -- TODO use luaautomation timers? - minetest.after(0, ilrs.update_waiting, "lck", pts) + if not nocallbacks then + minetest.after(0, ilrs.update_waiting, "lck", pts) + end end -- frees all route locks, even manual ones set with the tool, at a specific position function ilrs.remove_route_locks(pts, nocallbacks) diff --git a/advtrains_interlocking/tcb_ts_ui.lua b/advtrains_interlocking/tcb_ts_ui.lua index 5302b86..5ef7ca9 100644 --- a/advtrains_interlocking/tcb_ts_ui.lua +++ b/advtrains_interlocking/tcb_ts_ui.lua @@ -505,10 +505,10 @@ function advtrains.interlocking.show_signalling_form(sigd, pname, sel_rte) end end if not tcbs.route_auto then - form = form.."button[0.5,4.5; 5,1;auto;Enable Automatic Working]" + form = form.."button[0.5,7; 5,1;auto;Enable Automatic Working]" else - form = form.."label[0.5,4.5;Automatic Working is active.]" - form = form.."label[0.5,4.8;Route is re-set when a train passed.]" + form = form.."label[0.5,7 ;Automatic Working is active.]" + form = form.."label[0.5,7.3;Route is re-set when a train passed.]" end form = form.."button[0.5,6; 5,1;cancelroute;Cancel Route]" |