aboutsummaryrefslogtreecommitdiff
path: root/advtrains/helpers.lua
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2023-03-19 17:19:40 +0100
committerorwell96 <orwell@bleipb.de>2023-05-27 12:26:14 +0200
commita14eb7fe737ffc4df4077a01f4859d74f62d0af2 (patch)
tree088ec0a6306ee415a01a084d41cb11dfa40e1b5e /advtrains/helpers.lua
parent6a5540878f334e97b78ef1430698a8bf8b3faa99 (diff)
downloadadvtrains-a14eb7fe737ffc4df4077a01f4859d74f62d0af2.tar.gz
advtrains-a14eb7fe737ffc4df4077a01f4859d74f62d0af2.tar.bz2
advtrains-a14eb7fe737ffc4df4077a01f4859d74f62d0af2.zip
TCB Xlinking added, to make nonconnected crossings possible
Diffstat (limited to 'advtrains/helpers.lua')
-rw-r--r--advtrains/helpers.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/advtrains/helpers.lua b/advtrains/helpers.lua
index 6d22bc5..7e078fb 100644
--- a/advtrains/helpers.lua
+++ b/advtrains/helpers.lua
@@ -297,6 +297,7 @@ end
function advtrains.get_adjacent_rail(this_posnr, this_conns_p, conn_idx, drives_on)
local this_pos = advtrains.round_vector_floor_y(this_posnr)
local this_conns = this_conns_p
+ local _
if not this_conns then
_, this_conns = advtrains.get_rail_info_at(this_pos)
end
@@ -583,6 +584,7 @@ function advtrains.get_track_iterator(initial_pos, initial_connid, limit, follow
table.insert(ti.branches, {pos = initial_pos, connid = coni, limit=limit})
end
end
+ ti.limit = limit -- safeguard if someone adds a branch before calling anything
setmetatable(ti, {__index=trackiter_mt})
return ti
end