aboutsummaryrefslogtreecommitdiff
path: root/advtrains_luaautomation/atc_rail.lua
diff options
context:
space:
mode:
Diffstat (limited to 'advtrains_luaautomation/atc_rail.lua')
-rw-r--r--advtrains_luaautomation/atc_rail.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/advtrains_luaautomation/atc_rail.lua b/advtrains_luaautomation/atc_rail.lua
index ead1031..b98648e 100644
--- a/advtrains_luaautomation/atc_rail.lua
+++ b/advtrains_luaautomation/atc_rail.lua
@@ -99,7 +99,7 @@ function r.fire_event(pos, evtdata, appr_internal)
end
return fc_list
end,
- set_fc = function(fc_list)
+ set_fc = function(fc_list,reset_index)
assertt(fc_list, "table")
if not train_id then return false end
-- safety type-check for entered values
@@ -113,9 +113,9 @@ function r.fire_event(pos, evtdata, appr_internal)
if fc_list[index] then -- has FC to enter to this wagon
local data = advtrains.wagons[wagon_id]
if data then -- wagon actually exists
- --direct copy from wagons.lua, allowing for the :split function
+ --effectively copyied from wagons.lua, allowing for the :split function and reset_index
data.fc = fc_list[index]:split("!")
- if not data.fcind then
+ if reset_index or not data.fcind then
data.fcind = 1
elseif data.fcind > #data.fc then
data.fcind = #data.fc