aboutsummaryrefslogtreecommitdiff
path: root/advtrains_interlocking/demosignals.lua
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2020-01-30 08:45:16 +0100
committerorwell96 <orwell@bleipb.de>2021-02-10 16:36:24 +0100
commit119a09b784ad3f3c6bfd327f32164cb099f47f10 (patch)
treebf1d37de3ede0aa3d37e73ca64b7122dfd7edd54 /advtrains_interlocking/demosignals.lua
parent573d6b06b28c39872c1c036fc191c1c5e4b289a9 (diff)
downloadadvtrains-119a09b784ad3f3c6bfd327f32164cb099f47f10.tar.gz
advtrains-119a09b784ad3f3c6bfd327f32164cb099f47f10.tar.bz2
advtrains-119a09b784ad3f3c6bfd327f32164cb099f47f10.zip
Simplify Signal Aspect Table (H#132) [breaks compatibility with signal API]
Diffstat (limited to 'advtrains_interlocking/demosignals.lua')
-rw-r--r--advtrains_interlocking/demosignals.lua30
1 files changed, 8 insertions, 22 deletions
diff --git a/advtrains_interlocking/demosignals.lua b/advtrains_interlocking/demosignals.lua
index ab7a8b6..d5e1065 100644
--- a/advtrains_interlocking/demosignals.lua
+++ b/advtrains_interlocking/demosignals.lua
@@ -6,10 +6,10 @@
local setaspect = function(pos, node, asp)
- if not asp.main.free then
+ if asp.main == 0 then
advtrains.ndb.swap_node(pos, {name="advtrains_interlocking:ds_danger"})
else
- if asp.dst.free and asp.main.speed == -1 then
+ if asp.dst != 0 and asp.main == -1 then
advtrains.ndb.swap_node(pos, {name="advtrains_interlocking:ds_free"})
else
advtrains.ndb.swap_node(pos, {name="advtrains_interlocking:ds_slow"})
@@ -22,18 +22,10 @@ local setaspect = function(pos, node, asp)
end
local suppasp = {
- main = {
- free = nil,
- speed = {6, -1},
- },
- dst = {
- free = nil,
- speed = nil,
- },
- shunt = {
- free = false,
- proceed_as_main = true,
- },
+ main = {0, 6, -1},
+ dst = {0, false},
+ shunt = false,
+ proceed_as_main = true,
info = {
call_on = false,
dead_end = false,
@@ -74,10 +66,7 @@ minetest.register_node("advtrains_interlocking:ds_free", {
supported_aspects = suppasp,
get_aspect = function(pos, node)
return {
- main = {
- free = true,
- speed = -1,
- }
+ main = -1,
}
end,
},
@@ -98,10 +87,7 @@ minetest.register_node("advtrains_interlocking:ds_slow", {
supported_aspects = suppasp,
get_aspect = function(pos, node)
return {
- main = {
- free = true,
- speed = 6,
- }
+ main = 6,
}
end,
},