aboutsummaryrefslogtreecommitdiff
path: root/advtrains_interlocking/lzb.lua
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2019-01-21 20:49:48 +0100
committerorwell96 <orwell@bleipb.de>2019-01-21 20:50:42 +0100
commitcb48aea3e0c3f031e4023fa85e16edec90ac16b8 (patch)
tree38e06b8c86161ac5346f9bc363dea7db1b56473d /advtrains_interlocking/lzb.lua
parent8a33e7b93803803ca84e1cbc8f4bfac8a8c4c409 (diff)
downloadadvtrains-cb48aea3e0c3f031e4023fa85e16edec90ac16b8.tar.gz
advtrains-cb48aea3e0c3f031e4023fa85e16edec90ac16b8.tar.bz2
advtrains-cb48aea3e0c3f031e4023fa85e16edec90ac16b8.zip
Do not run LZB traverser when path does not exist
Diffstat (limited to 'advtrains_interlocking/lzb.lua')
-rw-r--r--advtrains_interlocking/lzb.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/advtrains_interlocking/lzb.lua b/advtrains_interlocking/lzb.lua
index 1f9589e..c352869 100644
--- a/advtrains_interlocking/lzb.lua
+++ b/advtrains_interlocking/lzb.lua
@@ -257,6 +257,10 @@ advtrains.te_register_on_new_path(function(id, train)
end)
advtrains.te_register_on_update(function(id, train)
+ if not train.path or not train.lzb then
+ atprint("LZB run: no path on train, skip step")
+ return
+ end
look_ahead(id, train)
apply_control(id, train)
end)