aboutsummaryrefslogtreecommitdiff
path: root/advtrains/trainlogic.lua
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2018-12-08 17:12:57 +0100
committerorwell96 <orwell@bleipb.de>2018-12-08 17:12:57 +0100
commitc3c5431412ddb65e08f55e56e1f51fb442b746b0 (patch)
tree03e15e99f6044427b093ffaf94779e1f22e9d874 /advtrains/trainlogic.lua
parente37f4f9188808c3a91be55ba90b9b666341af3cf (diff)
downloadadvtrains-c3c5431412ddb65e08f55e56e1f51fb442b746b0.tar.gz
advtrains-c3c5431412ddb65e08f55e56e1f51fb442b746b0.tar.bz2
advtrains-c3c5431412ddb65e08f55e56e1f51fb442b746b0.zip
Shunt signals (not exactly Ks), along with fixes in other components that those rely on
Diffstat (limited to 'advtrains/trainlogic.lua')
-rw-r--r--advtrains/trainlogic.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/advtrains/trainlogic.lua b/advtrains/trainlogic.lua
index a55c5dc..965fcbd 100644
--- a/advtrains/trainlogic.lua
+++ b/advtrains/trainlogic.lua
@@ -1036,8 +1036,14 @@ function advtrains.invert_train(train_id)
end
advtrains.update_trainpart_properties(train_id, true)
- -- TODO: this should actually be SHUNT_MAX_SPEED, but signals and lzb is not present everywhere
- train.speed_restriction = nil
+ -- If interlocking present, check whether this train is in a section and then set as shunt move after reversion
+ if advtrains.interlocking and train.il_sections and #train.il_sections > 0 then
+ train.is_shunt = true
+ train.speed_restriction = advtrains.SHUNT_SPEED_MAX
+ else
+ train.is_shunt = false
+ train.speed_restriction = nil
+ end
end
-- returns: train id, index of one of the trains that stand at this position.