1
0
mirror of https://github.com/Splizard/minetest-mod-snow.git synced 2024-11-16 14:50:18 +01:00

snow.legacy isnt used

This commit is contained in:
HybridDog 2015-05-29 10:27:59 +02:00
parent 0708ea6af3
commit d2e7ce77ba
2 changed files with 9 additions and 25 deletions

View File

@ -13,13 +13,10 @@ saplings grow into trees. --]]
-- Part 1: To disable the mapgen, add the *starting* comment under this line. -- Part 1: To disable the mapgen, add the *starting* comment under this line.
local mgname = ""
--Identify the mapgen. --Identify the mapgen.
minetest.register_on_mapgen_init(function(MapgenParams) minetest.register_on_mapgen_init(function(MapgenParams)
if MapgenParams.mgname then local mgname = MapgenParams.mgname
mgname = MapgenParams.mgname if not mgname then
else
io.write("[MOD] Snow Biomes: WARNING! mapgen could not be identifyed!\n") io.write("[MOD] Snow Biomes: WARNING! mapgen could not be identifyed!\n")
end end
if mgname == "v7" then if mgname == "v7" then

View File

@ -1,6 +1,5 @@
--Global config and function table. --Global config and function table.
snow = { snow = {
legacy = true,
sleds = true, sleds = true,
enable_snowfall = true, enable_snowfall = true,
lighter_snowfall = false, lighter_snowfall = false,
@ -13,15 +12,14 @@ snow = {
--Config documentation. --Config documentation.
local doc = { local doc = {
legacy = "Whether you are running a legacy minetest version (auto-detected).",
sleds = "Disable this to prevent sleds from being riden.", sleds = "Disable this to prevent sleds from being riden.",
enable_snowfall = "Enables falling snow.", enable_snowfall = "Enables falling snow.",
lighter_snowfall = "Reduces the amount of resources and fps used by snowfall.", lighter_snowfall = "Reduces the amount of resources and fps used by snowfall.",
debug = "Enables debug output. Currently it only prints mgapgen_v6 info.", debug = "Enables debug output. Currently it only prints mgv6 info.",
smooth_biomes = "Enables smooth transition of biomes", smooth_biomes = "Enables smooth transition of biomes (mgv6)",
christmas_content = "Disable this to remove christmas saplings from being found.",
smooth_snow = "Disable this to stop snow from being smoothed.", smooth_snow = "Disable this to stop snow from being smoothed.",
min_height = "The minumum height a snow biome will generate.", christmas_content = "Disable this to remove christmas saplings from being found.",
min_height = "The minumum height a snow biome will generate (mgv7)",
} }
--Manage config. --Manage config.
@ -64,7 +62,9 @@ local function loadConfig(path)
end end
end end
minetest.register_on_shutdown(function() saveConfig(minetest.get_modpath("snow").."/config.txt", snow, doc) end) minetest.register_on_shutdown(function()
saveConfig(minetest.get_modpath("snow").."/config.txt", snow, doc)
end)
local config = loadConfig(minetest.get_modpath("snow").."/config.txt") local config = loadConfig(minetest.get_modpath("snow").."/config.txt")
if config then if config then
@ -92,19 +92,6 @@ for i,v in pairs(snow) do
end end
end end
--AUTO DETECT and/or OVERIDEN values--
--legacy--
--Detect if we are running the latest minetest.
if minetest.register_on_mapgen_init then
snow.legacy = false
else
snow.legacy = true
end
if config
and snow.legacy ~= config.legacy then
saveConfig(minetest.get_modpath("snow").."/config.txt", snow, doc)
end
--MENU --MENU