aboutsummaryrefslogtreecommitdiff
path: root/advtrains_interlocking/lzb.lua
diff options
context:
space:
mode:
Diffstat (limited to 'advtrains_interlocking/lzb.lua')
-rw-r--r--advtrains_interlocking/lzb.lua12
1 files changed, 10 insertions, 2 deletions
diff --git a/advtrains_interlocking/lzb.lua b/advtrains_interlocking/lzb.lua
index c9e40ab..8781d40 100644
--- a/advtrains_interlocking/lzb.lua
+++ b/advtrains_interlocking/lzb.lua
@@ -177,14 +177,22 @@ local function apply_control(id, train)
train.ctrl.lzb = nil
end
-
-advtrains.te_register_on_new_path(function(id, train)
+local function invalidate(train)
train.lzb = {
trav = atfloor(train.index),
travsht = train.is_shunt,
oncoming = {}
}
train.ctrl.lzb = nil
+end
+
+function advtrains.interlocking.lzb_invalidate(train)
+ invalidate(train)
+end
+
+
+advtrains.te_register_on_new_path(function(id, train)
+ invalidate(train)
look_ahead(id, train)
end)