aboutsummaryrefslogtreecommitdiff
path: root/advtrains_interlocking/approach.lua
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2020-01-30 08:45:16 +0100
committerorwell96 <orwell@bleipb.de>2021-02-10 16:36:24 +0100
commit119a09b784ad3f3c6bfd327f32164cb099f47f10 (patch)
treebf1d37de3ede0aa3d37e73ca64b7122dfd7edd54 /advtrains_interlocking/approach.lua
parent573d6b06b28c39872c1c036fc191c1c5e4b289a9 (diff)
downloadadvtrains-119a09b784ad3f3c6bfd327f32164cb099f47f10.tar.gz
advtrains-119a09b784ad3f3c6bfd327f32164cb099f47f10.tar.bz2
advtrains-119a09b784ad3f3c6bfd327f32164cb099f47f10.zip
Simplify Signal Aspect Table (H#132) [breaks compatibility with signal API]
Diffstat (limited to 'advtrains_interlocking/approach.lua')
-rw-r--r--advtrains_interlocking/approach.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/advtrains_interlocking/approach.lua b/advtrains_interlocking/approach.lua
index 0894043..151f15a 100644
--- a/advtrains_interlocking/approach.lua
+++ b/advtrains_interlocking/approach.lua
@@ -73,17 +73,17 @@ advtrains.tnc_register_on_approach(function(pos, id, train, index, has_entered,
--interpreting aspect and determining speed to proceed
if travsht then
--shunt move
- if asp.shunt.free then
+ if asp.shunt then
nspd = SHUNT_SPEED_MAX
- elseif asp.shunt.proceed_as_main and asp.main.free then
- nspd = asp.main.speed
+ elseif asp.shunt.proceed_as_main and asp.main != 0 then
+ nspd = asp.main
travsht = false
end
else
--train move
- if asp.main.free then
- nspd = asp.main.speed
- elseif asp.shunt.free then
+ if asp.main != 0 then
+ nspd = asp.main
+ elseif asp.shunt then
nspd = SHUNT_SPEED_MAX
travsht = true
end