aboutsummaryrefslogtreecommitdiff
path: root/advtrains/tracks.lua
diff options
context:
space:
mode:
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