diff options
Diffstat (limited to 'advtrains_luaautomation/environment.lua')
-rwxr-xr-x[-rw-r--r--] | advtrains_luaautomation/environment.lua | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/advtrains_luaautomation/environment.lua b/advtrains_luaautomation/environment.lua index 63aa68d..6b1a283 100644..100755 --- a/advtrains_luaautomation/environment.lua +++ b/advtrains_luaautomation/environment.lua @@ -150,7 +150,7 @@ local static_env = { --interrupts are handled per node, position unknown. (same goes for digilines) --however external interrupts can be set here. interrupt_pos = function(parpos, imesg) - local pos=atlatc.pcnaming.resolve_pos(parpos) + local pos=atlatc.pcnaming.resolve_pos(parpos, "interrupt_pos") atlatc.interrupt.add(0, pos, {type="ext_int", ext_int=true, message=imesg}) end, -- sends an atc command to train regardless of where it is in the world @@ -223,6 +223,18 @@ if advtrains.interlocking then local pos = atlatc.pcnaming.resolve_pos(signal) return advtrains.interlocking.signal_set_aspect(pos) end + + --section_occupancy() + static_env.section_occupancy = function(ts_id) + if not ts_id then return nil end + ts_id = tostring(ts_id) + local response = advtrains.interlocking.db.get_ts(ts_id) + if response == nil then + return false + else + return response.trains + end + end end -- Lines-specific: |