diff options
author | rubenwardy <rubenwardy@gmail.com> | 2017-09-20 17:05:04 +0100 |
---|---|---|
committer | orwell96 <mono96.mml@gmail.com> | 2017-09-20 18:05:04 +0200 |
commit | d65c4916ceaeed6eec5fe3f344d4e71b3c96a80b (patch) | |
tree | ae2a4a1ca5bdbcb0a2a867287d4556f92478405a /advtrains/trackdb_legacy.lua | |
parent | b75c83ea43bb9f6e3bee2b4db955e2a9e7be885e (diff) | |
download | advtrains-d65c4916ceaeed6eec5fe3f344d4e71b3c96a80b.tar.gz advtrains-d65c4916ceaeed6eec5fe3f344d4e71b3c96a80b.tar.bz2 advtrains-d65c4916ceaeed6eec5fe3f344d4e71b3c96a80b.zip |
Remove zip release files, move mod to root, exclude assets from Makefile (#92)
Diffstat (limited to 'advtrains/trackdb_legacy.lua')
-rw-r--r-- | advtrains/trackdb_legacy.lua | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/advtrains/trackdb_legacy.lua b/advtrains/trackdb_legacy.lua new file mode 100644 index 0000000..99349e8 --- /dev/null +++ b/advtrains/trackdb_legacy.lua @@ -0,0 +1,27 @@ +--trackdb_legacy.lua +--loads the (old) track database. the only use for this is to provide data for rails that haven't been written into the ndb database. +--nothing will be saved. +--if the user thinks that he has loaded every track in his world at least once, he can delete the track database. + +--trackdb[[y][x][z]={conn1, conn2, rely1, rely2, railheight} + + +--trackdb keeps its own save file. +advtrains.fpath_tdb=minetest.get_worldpath().."/advtrains_trackdb2" +local file, err = io.open(advtrains.fpath_tdb, "r") +if not file then + atprint("Not loading a trackdb file.") +else + local tbl = minetest.deserialize(file:read("*a")) + if type(tbl) == "table" then + advtrains.trackdb=tbl + atprint("Loaded trackdb file.") + end + file:close() +end + + + + + + |