aboutsummaryrefslogtreecommitdiff
path: root/advtrains
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2019-01-22 23:24:05 +0100
committerorwell96 <orwell@bleipb.de>2019-01-22 23:26:20 +0100
commitf2a62c2d772b7242858be19934512fd9fc3d89fc (patch)
tree4e27b19bfa7d0ee7d117ed3921c8bcc531da59f0 /advtrains
parent2b871069617383eaa1c7d4fb89ccab766c9f68b0 (diff)
downloadadvtrains-f2a62c2d772b7242858be19934512fd9fc3d89fc.tar.gz
advtrains-f2a62c2d772b7242858be19934512fd9fc3d89fc.tar.bz2
advtrains-f2a62c2d772b7242858be19934512fd9fc3d89fc.zip
Fix atc command evaluation BB command
Diffstat (limited to 'advtrains')
-rw-r--r--advtrains/atc.lua14
1 files changed, 9 insertions, 5 deletions
diff --git a/advtrains/atc.lua b/advtrains/atc.lua
index 80b1b36..58d59af 100644
--- a/advtrains/atc.lua
+++ b/advtrains/atc.lua
@@ -179,11 +179,8 @@ local matchptn={
train.tarvelocity=tonumber(match)
return #match+1
end,
- ["B([0-9B]+)"]=function(id, train, match)
- if match=="B" then
- train.atc_brake_target = -1
- train.tarvelocity = 0
- elseif train.velocity>tonumber(match) then
+ ["B([0-9]+)"]=function(id, train, match)
+ if train.velocity>tonumber(match) then
train.atc_brake_target=tonumber(match)
if not train.tarvelocity or train.tarvelocity>train.atc_brake_target then
train.tarvelocity=train.atc_brake_target
@@ -191,6 +188,13 @@ local matchptn={
end
return #match+1
end,
+ ["BB"]=function(id, train)
+ if match=="B" then
+ train.atc_brake_target = -1
+ train.tarvelocity = 0
+ else
+ return 2
+ end,
["W"]=function(id, train)
train.atc_wait_finish=true
return 1