aboutsummaryrefslogtreecommitdiff
path: root/advtrains_interlocking/lzb.lua
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2019-01-15 17:23:03 +0100
committerorwell96 <orwell@bleipb.de>2019-01-15 17:23:03 +0100
commit3ce98cae9aa588fba0be1e86fc81e7ca6040bd9d (patch)
tree6427527fd2d3fe84ad41b49368fe0b3b868f6980 /advtrains_interlocking/lzb.lua
parent12f8e26cb47f2dc365c69ff721b4c3faf348c61d (diff)
downloadadvtrains-3ce98cae9aa588fba0be1e86fc81e7ca6040bd9d.tar.gz
advtrains-3ce98cae9aa588fba0be1e86fc81e7ca6040bd9d.tar.bz2
advtrains-3ce98cae9aa588fba0be1e86fc81e7ca6040bd9d.zip
Actual working ARS
Diffstat (limited to 'advtrains_interlocking/lzb.lua')
-rw-r--r--advtrains_interlocking/lzb.lua10
1 files changed, 9 insertions, 1 deletions
diff --git a/advtrains_interlocking/lzb.lua b/advtrains_interlocking/lzb.lua
index 51d597b..1f9589e 100644
--- a/advtrains_interlocking/lzb.lua
+++ b/advtrains_interlocking/lzb.lua
@@ -4,7 +4,7 @@
local function approach_callback(parpos, train_id, train, index)
local pos = advtrains.round_vector_floor_y(parpos)
-
+
local node=pnode or advtrains.ndb.get_node(pos)
local ndef=minetest.registered_nodes[node.name]
if ndef and ndef.advtrains and ndef.advtrains.on_train_approach then
@@ -88,6 +88,14 @@ local function look_ahead(id, train)
-- check for signal
local asp, spos = il.db.get_ip_signal_asp(pts, cn)
+
+ -- do ARS if needed
+ if spos then
+ local sigd = il.db.get_sigd_for_signal(spos)
+ if sigd then
+ il.ars_check(sigd, train)
+ end
+ end
--atdebug("trav: ",pos, cn, asp, spos, "travsht=", lzb.travsht)
if asp then
local nspd = 0