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, 18 insertions, 4 deletions
diff --git a/advtrains/signals.lua b/advtrains/signals.lua
index 59612cd..5fb1d1b 100644
--- a/advtrains/signals.lua
+++ b/advtrains/signals.lua
@@ -73,7 +73,9 @@ for r,f in pairs({on={as="off", ls="green", als="red"}, off={as="on", ls="red",
rules=advtrains.meseconrules,
["action_"..f.as] = function (pos, node)
advtrains.ndb.swap_node(pos, {name = "advtrains:retrosignal_"..f.as..rotation, param2 = node.param2}, true)
- advtrains.interlocking.signal_on_aspect_changed(pos)
+ if advtrains.interlocking then
+ advtrains.interlocking.signal_on_aspect_changed(pos)
+ end
end
}},
on_rightclick=function(pos, node, player)
@@ -85,7 +87,9 @@ for r,f in pairs({on={as="off", ls="green", als="red"}, off={as="on", ls="red",
advtrains.interlocking.show_ip_form(pos, pname)
elseif advtrains.check_turnout_signal_protection(pos, player:get_player_name()) then
advtrains.ndb.swap_node(pos, {name = "advtrains:retrosignal_"..f.as..rotation, param2 = node.param2}, true)
- advtrains.interlocking.signal_on_aspect_changed(pos)
+ if advtrains.interlocking then
+ advtrains.interlocking.signal_on_aspect_changed(pos)
+ end
end
end,
-- new signal API
@@ -134,7 +138,9 @@ for r,f in pairs({on={as="off", ls="green", als="red"}, off={as="on", ls="red",
rules=advtrains.meseconrules,
["action_"..f.as] = function (pos, node)
advtrains.setstate(pos, f.als, node)
- advtrains.interlocking.signal_on_aspect_changed(pos)
+ if advtrains.interlocking then
+ advtrains.interlocking.signal_on_aspect_changed(pos)
+ end
end
}},
on_rightclick=function(pos, node, player)
@@ -146,7 +152,9 @@ for r,f in pairs({on={as="off", ls="green", als="red"}, off={as="on", ls="red",
advtrains.interlocking.show_ip_form(pos, pname)
elseif advtrains.check_turnout_signal_protection(pos, player:get_player_name()) then
advtrains.setstate(pos, f.als, node)
- advtrains.interlocking.signal_on_aspect_changed(pos)
+ if advtrains.interlocking then
+ advtrains.interlocking.signal_on_aspect_changed(pos)
+ end
end
end,
-- new signal API
@@ -206,6 +214,9 @@ for r,f in pairs({on={as="off", ls="green", als="red"}, off={as="on", ls="red",
rules = mrules_wallsignal,
["action_"..f.as] = function (pos, node)
advtrains.setstate(pos, f.als, node)
+ if advtrains.interlocking then
+ advtrains.interlocking.signal_on_aspect_changed(pos)
+ end
end
}},
on_rightclick=function(pos, node, player)
@@ -217,6 +228,9 @@ for r,f in pairs({on={as="off", ls="green", als="red"}, off={as="on", ls="red",
advtrains.interlocking.show_ip_form(pos, pname)
elseif advtrains.check_turnout_signal_protection(pos, player:get_player_name()) then
advtrains.setstate(pos, f.als, node)
+ if advtrains.interlocking then
+ advtrains.interlocking.signal_on_aspect_changed(pos)
+ end
end
end,
-- new signal API