modify for new_lzb branch

This commit is contained in:
Gabriel Pérez-Cerezo 2021-02-11 12:26:28 +01:00
parent b5512ed80f
commit a847527b63

View File

@ -1,13 +1,14 @@
local setaspectf = function()
return function(pos, node, asp)
if not asp.main.free then
if asp.shunt.free then
if asp.main == 0 then
if asp.shunt then
advtrains.ndb.swap_node(pos, {name="linetrack:signal_shunt", param2 = node.param2})
else
advtrains.ndb.swap_node(pos, {name="linetrack:signal_danger", param2 = node.param2})
end
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="linetrack:signal_free", param2 = node.param2})
else
advtrains.ndb.swap_node(pos, {name="linetrack:signal_slow", param2 = node.param2})
@ -21,18 +22,10 @@ local setaspectf = function()
end
local suppasp = {
main = {
free = nil,
speed = {6, -1},
},
dst = {
free = nil,
speed = nil,
},
shunt = {
free = nil,
proceed_as_main = true,
},
main = {0, 6, -1},
dst = {0, false},
shunt = nil,
proceed_as_main = true,
info = {
call_on = false,
dead_end = false,
@ -40,11 +33,12 @@ local suppasp = {
}
}
for typ, prts in pairs({
danger = {asp = advtrains.interlocking.DANGER, n = "slow", ici=true},
slow = {asp = { main = { free = true, speed = 6 }, shunt = {proceed_as_main = true}} , n = "free"},
free = {asp = { main = { free = true, speed = -1 }, shunt = {proceed_as_main = true}} , n = "shunt"},
shunt = {asp = { main = {free = false}, shunt = {free = true} } , n = "danger"},
slow = {asp = { main = 6, proceed_as_main = true} , n = "free"},
free = {asp = { main = -1, proceed_as_main = true} , n = "shunt"},
shunt = {asp = { main = 0, shunt = true} , n = "danger"},
}) do
minetest.register_node("linetrack:signal_"..typ, {
description = "Generic Main Signal",