aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2018-11-20 12:11:40 +0100
committerorwell96 <orwell@bleipb.de>2018-11-20 12:12:28 +0100
commit4eb7531cc52b083b68673d4a8f9a8d271e60d37c (patch)
treeb8026f3464844898161332d06dae0097936608f1
parentf90a7a77ef9e76216fe4156e04223e032a91ec2c (diff)
downloadadvtrains-4eb7531cc52b083b68673d4a8f9a8d271e60d37c.tar.gz
advtrains-4eb7531cc52b083b68673d4a8f9a8d271e60d37c.tar.bz2
advtrains-4eb7531cc52b083b68673d4a8f9a8d271e60d37c.zip
Add set_aspect function
This allows incorporating signals implementing the signal API in LuaAutomation projects Note that it circumvents TCB assignments (a signal assigned to a TCB can be set to green even if no route is set
-rw-r--r--advtrains_luaautomation/environment.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/advtrains_luaautomation/environment.lua b/advtrains_luaautomation/environment.lua
index 40bc22a..5bf7527 100644
--- a/advtrains_luaautomation/environment.lua
+++ b/advtrains_luaautomation/environment.lua
@@ -211,6 +211,10 @@ if advtrains.interlocking then
local pos = atlatc.pcnaming.resolve_pos(signal)
return advtrains.interlocking.signal_get_aspect(pos)
end
+ static_env.set_aspect = function(signal, asp)
+ local pos = atlatc.pcnaming.resolve_pos(signal)
+ return advtrains.interlocking.signal_set_aspect(pos)
+ end
end
for _, name in pairs(safe_globals) do