aboutsummaryrefslogtreecommitdiff
path: root/advtrains/wagons.lua
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2019-12-11 12:25:08 +0100
committerorwell96 <orwell@bleipb.de>2021-02-10 16:35:45 +0100
commit816245588d62e3364b974be07989298887c45cfe (patch)
treeb4166f07a0396b43d6af7bd41d1295101117d947 /advtrains/wagons.lua
parent74a219937dd031743c880510f10571adec0cf8a8 (diff)
downloadadvtrains-816245588d62e3364b974be07989298887c45cfe.tar.gz
advtrains-816245588d62e3364b974be07989298887c45cfe.tar.bz2
advtrains-816245588d62e3364b974be07989298887c45cfe.zip
Disable ARS train flag and surrounding uses
Diffstat (limited to 'advtrains/wagons.lua')
-rw-r--r--advtrains/wagons.lua28
1 files changed, 18 insertions, 10 deletions
diff --git a/advtrains/wagons.lua b/advtrains/wagons.lua
index 1c663fe..522b649 100644
--- a/advtrains/wagons.lua
+++ b/advtrains/wagons.lua
@@ -999,6 +999,9 @@ function wagon:show_bordcom(pname)
end
i=i+1
end
+ if train.ars_disable then
+ form = form .. "button[4.5,7;5,1;ilarsenable;Clear 'Disable ARS' flag]"
+ end
end
minetest.show_formspec(pname, "advtrains_bordcom_"..self.id, form)
@@ -1071,18 +1074,23 @@ function wagon:handle_bordcom_fields(pname, formname, fields)
-- Interlocking functionality: If the interlocking module is loaded, you can set the signal aspect
-- from inside the train
- if fields.ilrs and advtrains.interlocking and train.lzb and #train.lzb.oncoming > 0 then
- local i=1
- while train.lzb.oncoming[i] do
- local oci = train.lzb.oncoming[i]
- if oci.udata and oci.udata.signal_pos then
- local sigd = advtrains.interlocking.db.get_sigd_for_signal(oci.udata.signal_pos)
- if sigd then
- advtrains.interlocking.show_signalling_form(sigd, pname)
- return
+ if advtrains.interlocking then
+ if fields.ilrs and train.lzb and #train.lzb.oncoming > 0 then
+ local i=1
+ while train.lzb.oncoming[i] do
+ local oci = train.lzb.oncoming[i]
+ if oci.udata and oci.udata.signal_pos then
+ local sigd = advtrains.interlocking.db.get_sigd_for_signal(oci.udata.signal_pos)
+ if sigd then
+ advtrains.interlocking.show_signalling_form(sigd, pname)
+ return
+ end
end
+ i=i+1
end
- i=i+1
+ end
+ if fields.ilarsenable then
+ advtrains.interlocking.ars_set_disable(train, false)
end
end