diff options
author | orwell96 <orwell@bleipb.de> | 2018-12-08 18:23:34 +0100 |
---|---|---|
committer | orwell96 <orwell@bleipb.de> | 2018-12-08 18:23:34 +0100 |
commit | 7a970dd4fab46461ee6dc43064b7972bac6304ea (patch) | |
tree | 876753ec4536c2483109726f16c6ea1240c5b082 /advtrains_interlocking | |
parent | c3c5431412ddb65e08f55e56e1f51fb442b746b0 (diff) | |
download | advtrains-7a970dd4fab46461ee6dc43064b7972bac6304ea.tar.gz advtrains-7a970dd4fab46461ee6dc43064b7972bac6304ea.tar.bz2 advtrains-7a970dd4fab46461ee6dc43064b7972bac6304ea.zip |
Signs (static signals)
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 |