aboutsummaryrefslogtreecommitdiff
path: root/advtrains_interlocking
diff options
context:
space:
mode:
authororwell <orwell@bleipb.de>2025-03-25 22:31:45 +0100
committerorwell <orwell@bleipb.de>2025-03-25 22:31:45 +0100
commit5fc9a3073f5c7800b986b0fbcdeaf98d1387e088 (patch)
treefbaccfa49998d5bc38115fe203723e3fd5ba81ea /advtrains_interlocking
parent0b7fdc66bc2fbc47aff7bc6b494e6bd3cff29728 (diff)
downloadadvtrains-5fc9a3073f5c7800b986b0fbcdeaf98d1387e088.tar.gz
advtrains-5fc9a3073f5c7800b986b0fbcdeaf98d1387e088.tar.bz2
advtrains-5fc9a3073f5c7800b986b0fbcdeaf98d1387e088.zip
fix undeclared global accessesHEADmaster
Diffstat (limited to 'advtrains_interlocking')
-rw-r--r--advtrains_interlocking/route_prog.lua3
-rw-r--r--advtrains_interlocking/routesetting.lua4
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)