diff options
Diffstat (limited to 'advtrains_interlocking')
-rw-r--r-- | advtrains_interlocking/lzb.lua | 2 | ||||
-rw-r--r-- | advtrains_interlocking/signal_api.lua | 10 |
2 files changed, 10 insertions, 2 deletions
diff --git a/advtrains_interlocking/lzb.lua b/advtrains_interlocking/lzb.lua index 11871f1..51d597b 100644 --- a/advtrains_interlocking/lzb.lua +++ b/advtrains_interlocking/lzb.lua @@ -136,6 +136,7 @@ local function look_ahead(id, train) pos = spos, idx = trav, spd = lspd, + sht = lzb.travsht, }) end end @@ -165,6 +166,7 @@ local function apply_control(id, train) if lzb.oncoming[i].idx < train.index-0.5 then if not lzb.oncoming[i].npr then train.speed_restriction = lzb.oncoming[i].spd + train.is_shunt = lzb.oncoming[i].sht end table.remove(lzb.oncoming, i) else diff --git a/advtrains_interlocking/signal_api.lua b/advtrains_interlocking/signal_api.lua index 4d75f28..f33edde 100644 --- a/advtrains_interlocking/signal_api.lua +++ b/advtrains_interlocking/signal_api.lua @@ -239,8 +239,14 @@ function advtrains.interlocking.signal_rc_handler(pos, node, player, itemstack, if sigd then advtrains.interlocking.show_signalling_form(sigd, pname) else - -- permit to set aspect manually - minetest.show_formspec(pname, "at_il_sigasp_"..minetest.pos_to_string(pos), "field[aspect;Set Aspect ('A' to assign IP);D0D0D]") + local ndef = minetest.registered_nodes[node.name] + if ndef.advtrains and ndef.advtrains.set_aspect then + -- permit to set aspect manually + minetest.show_formspec(pname, "at_il_sigasp_"..minetest.pos_to_string(pos), "field[aspect;Set Aspect ('A' to assign IP);D0D0D]") + else + --static signal - only IP + advtrains.interlocking.show_ip_form(pos, pname) + end end end |