aboutsummaryrefslogtreecommitdiff
path: root/advtrains/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'advtrains/init.lua')
-rw-r--r--advtrains/init.lua14
1 files changed, 13 insertions, 1 deletions
diff --git a/advtrains/init.lua b/advtrains/init.lua
index 21b414e..8173a22 100644
--- a/advtrains/init.lua
+++ b/advtrains/init.lua
@@ -196,7 +196,7 @@ dofile(advtrains.modpath.."/passive.lua")
--load/save
-- backup variables, used if someone should accidentally delete a sub-mod
-local MDS_interlocking
+local MDS_interlocking, MDS_lines
advtrains.fpath=minetest.get_worldpath().."/advtrains"
@@ -226,6 +226,11 @@ function advtrains.avt_load()
else
MDS_interlocking = tbl.interlocking
end
+ if advtrains.lines then
+ advtrains.lines.load(tbl.lines)
+ else
+ MDS_lines = tbl.lines
+ end
--remove wagon_save entries that are not part of a train
local todel=advtrains.merge_tables(advtrains.wagon_save)
for tid, train in pairs(advtrains.trains) do
@@ -327,6 +332,12 @@ advtrains.avt_save = function(remove_players_from_wagons)
else
il_save = MDS_interlocking
end
+ local ln_save
+ if advtrains.lines then
+ ln_save = advtrains.lines.save()
+ else
+ ln_save = MDS_lines
+ end
local save_tbl={
trains = tmp_trains,
wagon_save = advtrains.wagons,
@@ -334,6 +345,7 @@ advtrains.avt_save = function(remove_players_from_wagons)
atc = advtrains.atc.save_data(),
ndb = advtrains.ndb.save_data(),
interlocking = il_save,
+ lines = ln_save,
version = 2,
}
local datastr = minetest.serialize(save_tbl)