diff options
Diffstat (limited to 'advtrains_interlocking')
-rw-r--r-- | advtrains_interlocking/route_prog.lua | 3 | ||||
-rw-r--r-- | advtrains_interlocking/routesetting.lua | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/advtrains_interlocking/route_prog.lua b/advtrains_interlocking/route_prog.lua index 71ebdf3..81aa133 100644 --- a/advtrains_interlocking/route_prog.lua +++ b/advtrains_interlocking/route_prog.lua @@ -175,6 +175,9 @@ function advtrains.interlocking.visualize_route(origin, route, context, tmp_lcks -- display locks for pts, state in pairs(v.locks) do local pos = minetest.string_to_pos(pts) + if not pos then + pos = advtrains.decode_pos(pts) + end routesprite(context, pos, "fix"..k..pts, "at_il_route_lock.png", "Fixed in state '"..state.."' by route "..route.name.." until segment #"..k.." is freed.") end end diff --git a/advtrains_interlocking/routesetting.lua b/advtrains_interlocking/routesetting.lua index 6544a92..1065cad 100644 --- a/advtrains_interlocking/routesetting.lua +++ b/advtrains_interlocking/routesetting.lua @@ -86,8 +86,8 @@ function ilrs.set_route(signal, route, try) local c_locks = {} if route.use_rscache and c_ts.rs_cache and c_rseg.next then -- rscache needs to be enabled, present and next must be defined - start_pkey = advtrains.encode_pos(c_sigd.p) - end_pkey = advtrains.encode_pos(c_rseg.next.p) + local start_pkey = advtrains.encode_pos(c_sigd.p) + local end_pkey = advtrains.encode_pos(c_rseg.next.p) if c_ts.rs_cache[start_pkey] and c_ts.rs_cache[start_pkey][end_pkey] then for lp,lst in pairs(c_ts.rs_cache[start_pkey][end_pkey]) do --atdebug("Add lock from RSCache:",lp,"->",lst) |