From 042dcd241d135af73fd5b464369139cfbff8e1bc Mon Sep 17 00:00:00 2001 From: orwell96 Date: Sat, 23 Feb 2019 10:37:48 +0100 Subject: Do not clear LZB control when invalidating. Prevents trains accelerating towards red signals on /at_reroute --- advtrains_interlocking/lzb.lua | 5 +++-- 1 file 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) -- cgit v1.2.3