aboutsummaryrefslogtreecommitdiff
path: root/advtrains/trainlogic.lua
diff options
context:
space:
mode:
authorGabriel Pérez-Cerezo <gabriel@gpcf.eu>2020-07-26 23:28:24 +0200
committerGabriel Pérez-Cerezo <gabriel@gpcf.eu>2020-07-26 23:30:07 +0200
commit45413ee5c031d9d44342a09f4ac8b412a75568be (patch)
tree3502fafaed7d8e4fca704b09cab3381f694a1453 /advtrains/trainlogic.lua
parentc54e0b341a88349e1a4fc7d902fdd9d9e1a6040d (diff)
downloadadvtrains-45413ee5c031d9d44342a09f4ac8b412a75568be.tar.gz
advtrains-45413ee5c031d9d44342a09f4ac8b412a75568be.tar.bz2
advtrains-45413ee5c031d9d44342a09f4ac8b412a75568be.zip
Add function to step through freight codes
Diffstat (limited to 'advtrains/trainlogic.lua')
-rw-r--r--advtrains/trainlogic.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/advtrains/trainlogic.lua b/advtrains/trainlogic.lua
index 1bda0f2..2c2e247 100644
--- a/advtrains/trainlogic.lua
+++ b/advtrains/trainlogic.lua
@@ -922,6 +922,16 @@ function advtrains.split_train_at_fc(train)
end
end
+function advtrains.train_step_fc(train)
+ for i=1,#train.trainparts do
+ local w_id = train.trainparts[i]
+ local data = advtrains.wagons[w_id]
+ if data then
+ advtrains.step_fc(data)
+ end
+ end
+end
+
function advtrains.split_train_at_index(train, index)
-- this function splits a train at index, creating a new train from the back part of the train.