From 9c79b176cdbcc7cf5babafc90e68e8cb4d6cceeb Mon Sep 17 00:00:00 2001 From: Gael-de-Sailly Date: Sun, 8 Mar 2015 10:48:56 +0100 Subject: [PATCH] Activated versions manager --- init.lua | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/init.lua b/init.lua index 4bce498..e632f96 100644 --- a/init.lua +++ b/init.lua @@ -1,5 +1,5 @@ vmg = {} -vmg.version = "1.0" +vmg.version = "1.1" local path = minetest.get_modpath("valleys_mapgen") @@ -39,17 +39,15 @@ end vmg.settings = Settings(minetest.get_worldpath() .. "/vmg.conf") --- mapgen versions manager is useless before the second version - ---local version = vmg.settings:get("version") ---if not version then +local version = vmg.settings:get("version") +if not version then vmg.settings:set("version", vmg.version) dofile(path .. "/mapgen.lua") ---elseif version == vmg.version then - --dofile(path .. "/mapgen.lua") ---else - --dofile(path .. "/old_mapgens/" .. vmg.version .. ".lua") ---end +elseif version == vmg.version then + dofile(path .. "/mapgen.lua") +else + dofile(path .. "/old_mapgens/" .. version .. ".lua") +end vmg.settings:write()