diff options
author | orwell96 <orwell@bleipb.de> | 2019-03-15 18:17:18 +0100 |
---|---|---|
committer | orwell96 <orwell@bleipb.de> | 2019-03-15 18:17:18 +0100 |
commit | 5738ab46aa5c768b973ef892635fb1642c5f6b9c (patch) | |
tree | 73f6c5983c13ba6d4e12e621d6cc92152ff78332 /advtrains_interlocking/ars.lua | |
parent | 1227456d46a5e47fa744c37bbf92e05515a871a2 (diff) | |
download | advtrains-5738ab46aa5c768b973ef892635fb1642c5f6b9c.tar.gz advtrains-5738ab46aa5c768b973ef892635fb1642c5f6b9c.tar.bz2 advtrains-5738ab46aa5c768b973ef892635fb1642c5f6b9c.zip |
Disable-ARS switch in signal and set this when cancelling an ARS route
Diffstat (limited to 'advtrains_interlocking/ars.lua')
-rw-r--r-- | advtrains_interlocking/ars.lua | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/advtrains_interlocking/ars.lua b/advtrains_interlocking/ars.lua index ef5d0da..5bb56fa 100644 --- a/advtrains_interlocking/ars.lua +++ b/advtrains_interlocking/ars.lua @@ -114,8 +114,16 @@ function advtrains.interlocking.ars_check(sigd, train) local tcbs = il.db.get_tcbs(sigd) if not tcbs or not tcbs.routes then return end + if tcbs.ars_disabled then + -- No-ARS mode of signal. + -- ignore... + return + end + if tcbs.routeset then -- ARS is not in effect when a route is already set + -- just "punch" routesetting, just in case callback got lost. + minetest.after(0, il.route.update_route, sigd, tcbs, nil, nil) return end @@ -124,8 +132,5 @@ function advtrains.interlocking.ars_check(sigd, train) --delay routesetting, it should not occur inside train step -- using after here is OK because that gets called on every path recalculation minetest.after(0, il.route.update_route, sigd, tcbs, rteid, nil) - else - -- just "punch" routesetting, just in case callback got lost. - minetest.after(0, il.route.update_route, sigd, tcbs, nil, nil) end end |