diff options
author | orwell96 <orwell@bleipb.de> | 2019-02-23 10:37:48 +0100 |
---|---|---|
committer | orwell96 <orwell@bleipb.de> | 2019-02-23 10:37:48 +0100 |
commit | 042dcd241d135af73fd5b464369139cfbff8e1bc (patch) | |
tree | 7032559d75c0da71ab385a3c8592cfd04467ff73 /advtrains_interlocking/lzb.lua | |
parent | e5c4e8cc1fdc17f016a5a1956041ddc5cd0d407d (diff) | |
download | advtrains-042dcd241d135af73fd5b464369139cfbff8e1bc.tar.gz advtrains-042dcd241d135af73fd5b464369139cfbff8e1bc.tar.bz2 advtrains-042dcd241d135af73fd5b464369139cfbff8e1bc.zip |
Do not clear LZB control when invalidating.
Prevents trains accelerating towards red signals on /at_reroute
Diffstat (limited to 'advtrains_interlocking/lzb.lua')
-rw-r--r-- | advtrains_interlocking/lzb.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/advtrains_interlocking/lzb.lua b/advtrains_interlocking/lzb.lua index eeddc77..8541525 100644 --- a/advtrains_interlocking/lzb.lua +++ b/advtrains_interlocking/lzb.lua @@ -183,7 +183,7 @@ local function apply_control(id, train) local i = 1 while i<=#lzb.oncoming do - if lzb.oncoming[i].idx < train.index-0.5 then + if lzb.oncoming[i].idx < train.index then local ent = lzb.oncoming[i] local nodelete if not ent.npr then @@ -256,7 +256,8 @@ local function invalidate(train) travsht = train.is_shunt, oncoming = {} } - train.ctrl.lzb = nil + -- possible FIX: do not clear LZB control when invalidating. This will be cleared when apply_control is run next time + --train.ctrl.lzb = nil end function advtrains.interlocking.lzb_invalidate(train) |