aboutsummaryrefslogtreecommitdiff
path: root/advtrains/lzb.lua
diff options
context:
space:
mode:
authorywang <yw05@forksworld.de>2020-01-12 18:11:18 +0100
committerywang <yw05@forksworld.de>2020-04-12 16:07:59 +0200
commitd34e054c6d6029ce7b58f6d2afedfa6253caa6c4 (patch)
tree16ad95d2aa99bad97398cc404d6cfb41ae76a5b4 /advtrains/lzb.lua
parent8ac48f6169465c8550e75bbd0757d0c34115e658 (diff)
downloadadvtrains-d34e054c6d6029ce7b58f6d2afedfa6253caa6c4.tar.gz
advtrains-d34e054c6d6029ce7b58f6d2afedfa6253caa6c4.tar.bz2
advtrains-d34e054c6d6029ce7b58f6d2afedfa6253caa6c4.zip
Fix problem related to long distance between train and LZB point
Diffstat (limited to 'advtrains/lzb.lua')
-rw-r--r--advtrains/lzb.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/advtrains/lzb.lua b/advtrains/lzb.lua
index 794ad42..da3b4b6 100644
--- a/advtrains/lzb.lua
+++ b/advtrains/lzb.lua
@@ -96,8 +96,10 @@ function advtrains.lzb_get_limit_zone(train, lzb, lever, vel)
elseif v0 <= 0 then s = s + params.ADD_STAND
else s = s + params.ADD_SLOW
end
- if lvr >= 2 then s = s + params.ZONE_HOLD end
- if lvr >= 3 then s = s + params.ZONE_ROLL end
+ if v0 >= params.ZONE_VSLOW then
+ if lvr >= 2 then s = s + params.ZONE_HOLD end
+ if lvr >= 3 then s = s + params.ZONE_ROLL end
+ end
return advtrains.path_get_index_by_offset(train, lzb.idx, -s)
end