aboutsummaryrefslogtreecommitdiff
path: root/advtrains/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'advtrains/init.lua')
-rw-r--r--advtrains/init.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/advtrains/init.lua b/advtrains/init.lua
index 65e5048..0043c22 100644
--- a/advtrains/init.lua
+++ b/advtrains/init.lua
@@ -184,6 +184,10 @@ function advtrains.avt_load()
if tbl.version then
--congrats, we have the new save format.
advtrains.trains = tbl.trains
+ --Save the train id into the train table to avoid having to pass id around
+ for id, train in pairs(advtrains.trains) do
+ train.id = id
+ end
advtrains.wagon_save = tbl.wagon_save
advtrains.player_to_train_mapping = tbl.ptmap or {}
advtrains.ndb.load_data(tbl.ndb)