From 3d3752f50aff5889c699e6ba7c27ee1899f890e9 Mon Sep 17 00:00:00 2001 From: orwell Date: Thu, 9 Jan 2025 09:09:08 +0100 Subject: Convert old PTS format on freeing route locks (route_post is not migrated) --- advtrains_interlocking/routesetting.lua | 5 +++++ 1 file changed, 5 insertions(+) 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 -- cgit v1.2.3