aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authororwell <orwell@bleipb.de>2025-01-09 09:09:08 +0100
committerorwell <orwell@bleipb.de>2025-01-09 09:09:08 +0100
commit3d3752f50aff5889c699e6ba7c27ee1899f890e9 (patch)
tree40de47631d0f5cc48337a6f5fa012fc07eb7453d
parent021332c4aaaf8cfd18b3f08e5f069b203097f01d (diff)
downloadadvtrains-3d3752f50aff5889c699e6ba7c27ee1899f890e9.tar.gz
advtrains-3d3752f50aff5889c699e6ba7c27ee1899f890e9.tar.bz2
advtrains-3d3752f50aff5889c699e6ba7c27ee1899f890e9.zip
Convert old PTS format on freeing route locks (route_post is not migrated)
-rw-r--r--advtrains_interlocking/routesetting.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/advtrains_interlocking/routesetting.lua b/advtrains_interlocking/routesetting.lua
index 0668e62..6544a92 100644
--- a/advtrains_interlocking/routesetting.lua
+++ b/advtrains_interlocking/routesetting.lua
@@ -265,6 +265,11 @@ function ilrs.free_route_locks(ts, lcks, nocallbacks)
end
function ilrs.free_route_locks_indiv(pts, ts, nocallbacks)
+ -- legacy: if starts with bracket then pts is still in old pos_to_string format (may happen because ts.route_post is not migrated)
+ if string.match(pts, "^%(") then
+ atdebug("free_route_locks_indiv: converting position",pts)
+ pts = advtrains.encode_pos(minetest.string_to_pos(pts))
+ end
local e = ilrs.rte_locks[pts]
if not e then return nil
elseif #e==0 then