From 7537d2026f71ee7dd43f62812d3e8f8e7454f4d2 Mon Sep 17 00:00:00 2001 From: orwell96 Date: Tue, 22 Jan 2019 21:38:01 +0100 Subject: another small fix for route_ui --- advtrains_interlocking/route_ui.lua | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/advtrains_interlocking/route_ui.lua b/advtrains_interlocking/route_ui.lua index a843ae4..9b1a0da 100644 --- a/advtrains_interlocking/route_ui.lua +++ b/advtrains_interlocking/route_ui.lua @@ -103,14 +103,16 @@ function atil.show_route_edit_form(pname, sigd, routeid) c_rseg = route[i] c_lckp = {} - itab(""..i.." Entry "..sigd_to_string(c_sigd).." -> Sec. "..c_ts.name.." -> Exit "..(c_rseg.next and sigd_to_string(c_rseg.next) or "END")) + itab(""..i.." Entry "..sigd_to_string(c_sigd).." -> Sec. "..(c_ts and c_ts.name or "-").." -> Exit "..(c_rseg.next and sigd_to_string(c_rseg.next) or "END")) - for pts, state in pairs(c_rseg.locks) do - - local pos = minetest.string_to_pos(pts) - itab(" Lock: "..pts.." -> "..state) - if not advtrains.is_passive(pos) then - itab("-!- No passive component at "..pts..". Please reconfigure route!") + if c_rseg.locks then + for pts, state in pairs(c_rseg.locks) do + + local pos = minetest.string_to_pos(pts) + itab(" Lock: "..pts.." -> "..state) + if not advtrains.is_passive(pos) then + itab("-!- No passive component at "..pts..". Please reconfigure route!") + end end end -- advance -- cgit v1.2.3