diff options
Diffstat (limited to 'advtrains_luaautomation/environment.lua')
-rwxr-xr-x[-rw-r--r--] | advtrains_luaautomation/environment.lua | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/advtrains_luaautomation/environment.lua b/advtrains_luaautomation/environment.lua index e93b9c3..6b1a283 100644..100755 --- a/advtrains_luaautomation/environment.lua +++ b/advtrains_luaautomation/environment.lua @@ -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: |