aboutsummaryrefslogtreecommitdiff
path: root/advtrains/init.lua
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2019-01-24 17:50:26 +0100
committerorwell96 <orwell@bleipb.de>2019-01-24 17:50:26 +0100
commit9da148347d304ec2f26af6f813e26cb02bc6a6e7 (patch)
tree5cd8b9f486821bcaa984246153e957c157765912 /advtrains/init.lua
parent2976bae4522a1682808db55473d9f824c7155cc6 (diff)
downloadadvtrains-9da148347d304ec2f26af6f813e26cb02bc6a6e7.tar.gz
advtrains-9da148347d304ec2f26af6f813e26cb02bc6a6e7.tar.bz2
advtrains-9da148347d304ec2f26af6f813e26cb02bc6a6e7.zip
Basic functions of "stop rail", missing ARS rules and signal.
For signal, need to think of a callback system for signals and moving atlatc queue to core?
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)