aboutsummaryrefslogtreecommitdiff
path: root/advtrains/atc.lua
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2018-08-12 16:36:20 +0200
committerorwell96 <orwell@bleipb.de>2018-08-12 16:36:20 +0200
commit0ec89364c01eceb5c47f9cc3503d3561064b7fdb (patch)
treeb34f670881aa19a2266fdbf4ce825a500399115d /advtrains/atc.lua
parentd7e29180099fceb7fec8a84efddf9ca7b53194d0 (diff)
downloadadvtrains-0ec89364c01eceb5c47f9cc3503d3561064b7fdb.tar.gz
advtrains-0ec89364c01eceb5c47f9cc3503d3561064b7fdb.tar.bz2
advtrains-0ec89364c01eceb5c47f9cc3503d3561064b7fdb.zip
Fix ATC rail reversing
Diffstat (limited to 'advtrains/atc.lua')
-rw-r--r--advtrains/atc.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/advtrains/atc.lua b/advtrains/atc.lua
index 8e23205..22de4ca 100644
--- a/advtrains/atc.lua
+++ b/advtrains/atc.lua
@@ -194,9 +194,9 @@ local matchptn={
return #match+1
end,
["R"]=function(id, train)
- if train.velocity<=0 then --TODO this code still uses movedir
- train.movedir=train.movedir*-1
- train.atc_arrow = not train.atc_arrow
+ if train.velocity<=0 then
+ advtrains.invert_train(id)
+ advtrains.train_ensure_init(id, train)
else
atwarn(sid(id), attrans("ATC Reverse command warning: didn't reverse train, train moving!"))
end
@@ -205,7 +205,7 @@ local matchptn={
["O([LRC])"]=function(id, train, match)
local tt={L=-1, R=1, C=0}
local arr=train.atc_arrow and 1 or -1
- train.door_open = tt[match]*arr*train.movedir
+ train.door_open = tt[match]*arr
return 2
end,
}