aboutsummaryrefslogtreecommitdiff
path: root/advtrains/signals.lua
diff options
context:
space:
mode:
Diffstat (limited to 'advtrains/signals.lua')
-rw-r--r--advtrains/signals.lua22
1 files changed, 7 insertions, 15 deletions
diff --git a/advtrains/signals.lua b/advtrains/signals.lua
index 2bad1d4..1940518 100644
--- a/advtrains/signals.lua
+++ b/advtrains/signals.lua
@@ -12,18 +12,10 @@ end
local function aspect(b)
return {
- main = {
- free = b,
- speed = -1,
- },
- shunt = {
- free = false,
- proceed_as_main = true
- },
- dst = {
- free = true,
- speed = -1,
- },
+ main = (not b) and 0, -- b ? false : 0
+ shunt = false,
+ proceed_as_main = true,
+ dst = false,
info = {}
}
end
@@ -81,7 +73,7 @@ for r,f in pairs({on={as="off", ls="green", als="red"}, off={as="on", ls="red",
-- new signal API
advtrains = {
set_aspect = function(pos, node, asp)
- if asp.main.free then
+ if asp.main != 0 then
advtrains.ndb.swap_node(pos, {name = "advtrains:retrosignal_on"..rotation, param2 = node.param2}, true)
else
advtrains.ndb.swap_node(pos, {name = "advtrains:retrosignal_off"..rotation, param2 = node.param2}, true)
@@ -140,7 +132,7 @@ for r,f in pairs({on={as="off", ls="green", als="red"}, off={as="on", ls="red",
-- new signal API
advtrains = {
set_aspect = function(pos, node, asp)
- if asp.main.free then
+ if asp.main != 0 then
advtrains.ndb.swap_node(pos, {name = "advtrains:signal_on"..rotation, param2 = node.param2}, true)
else
advtrains.ndb.swap_node(pos, {name = "advtrains:signal_off"..rotation, param2 = node.param2}, true)
@@ -208,7 +200,7 @@ for r,f in pairs({on={as="off", ls="green", als="red"}, off={as="on", ls="red",
-- new signal API
advtrains = {
set_aspect = function(pos, node, asp)
- if asp.main.free then
+ if asp.main != 0 then
advtrains.ndb.swap_node(pos, {name = "advtrains:signal_wall_"..loc.."_on", param2 = node.param2}, true)
else
advtrains.ndb.swap_node(pos, {name = "advtrains:signal_wall_"..loc.."_off", param2 = node.param2}, true)