aboutsummaryrefslogtreecommitdiff
path: root/advtrains/tracks.lua
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2018-07-21 16:31:00 +0200
committerorwell96 <orwell@bleipb.de>2018-07-21 16:31:00 +0200
commitc34794e8a1a28826a7e8443b46fa76e0de238978 (patch)
treec4b424764498f14dad06640607e557280f715c7c /advtrains/tracks.lua
parent5fc5eb9c2abd1cc30277cfda953b4696274ecd31 (diff)
downloadadvtrains-c34794e8a1a28826a7e8443b46fa76e0de238978.tar.gz
advtrains-c34794e8a1a28826a7e8443b46fa76e0de238978.tar.bz2
advtrains-c34794e8a1a28826a7e8443b46fa76e0de238978.zip
Implement routesetting
Missing things: signal aspect updating, waiting routes handling, management /info tool
Diffstat (limited to 'advtrains/tracks.lua')
-rw-r--r--advtrains/tracks.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/advtrains/tracks.lua b/advtrains/tracks.lua
index 559ada7..092a1ec 100644
--- a/advtrains/tracks.lua
+++ b/advtrains/tracks.lua
@@ -304,7 +304,8 @@ function advtrains.register_tracks(tracktype, def, preset)
if var.switchalt and var.switchst then
local switchfunc=function(pos, node, newstate)
- if newstate~=var.switchst and not advtrains.get_train_at_pos(pos) then
+ if newstate~=var.switchst and not advtrains.get_train_at_pos(pos)
+ and not (advtrains.interlocking and advtrains.interlocking.route.has_route_lock(advtrains.roundfloorpts(pos)) ) then --TODO schöner machen
advtrains.ndb.swap_node(pos, {name=def.nodename_prefix.."_"..var.switchalt..rotation, param2=node.param2})
advtrains.invalidate_all_paths(pos)
end