aboutsummaryrefslogtreecommitdiff
path: root/advtrains_interlocking/lzb.lua
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2019-02-23 10:37:48 +0100
committerorwell96 <orwell@bleipb.de>2019-02-23 10:37:48 +0100
commit042dcd241d135af73fd5b464369139cfbff8e1bc (patch)
tree7032559d75c0da71ab385a3c8592cfd04467ff73 /advtrains_interlocking/lzb.lua
parente5c4e8cc1fdc17f016a5a1956041ddc5cd0d407d (diff)
downloadadvtrains-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.lua5
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)