aboutsummaryrefslogtreecommitdiff
path: root/advtrains_luaautomation/atc_rail.lua
diff options
context:
space:
mode:
authorMaverick2797 <git.maverick2797@gmail.com>2024-10-30 21:06:29 +0800
committerorwell <orwell@bleipb.de>2024-11-09 22:32:23 +0100
commit715efe22939bbe472ba4a2c81c74e64c45726bc2 (patch)
treebd7cffc02bcc1ecf958f14930a8a3f2ed4c480f8 /advtrains_luaautomation/atc_rail.lua
parent322fc31e74151a0ce6a14b49185b0ec9000ff5b2 (diff)
downloadadvtrains-715efe22939bbe472ba4a2c81c74e64c45726bc2.tar.gz
advtrains-715efe22939bbe472ba4a2c81c74e64c45726bc2.tar.bz2
advtrains-715efe22939bbe472ba4a2c81c74e64c45726bc2.zip
Add get_fc_index() fucntion
Diffstat (limited to 'advtrains_luaautomation/atc_rail.lua')
-rw-r--r--advtrains_luaautomation/atc_rail.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/advtrains_luaautomation/atc_rail.lua b/advtrains_luaautomation/atc_rail.lua
index 177fa78..dd26f51 100644
--- a/advtrains_luaautomation/atc_rail.lua
+++ b/advtrains_luaautomation/atc_rail.lua
@@ -99,6 +99,14 @@ function r.fire_event(pos, evtdata, appr_internal)
end
return fc_list
end,
+ get_fc_index = function()
+ if not train_id then return end
+ local fc_index_list = {}
+ for widx, wagon_id in ipars(train.trainparts) do
+ fc_index_list[widx] = advtrains.wagons[wagon_id].fcind or 1
+ end
+ return fc_index_list
+ end,
set_fc = function(fc_list,reset_index)
assertt(fc_list, "table")
if not train_id then return false end