mirror of
https://github.com/luanti-org/luanti.git
synced 2025-09-30 19:22:14 +00:00
clean up logic
This commit is contained in:
parent
7d075d4fcb
commit
cf5b57a977
1 changed files with 4 additions and 5 deletions
|
@ -80,7 +80,7 @@ local mgv6_biomes = {
|
||||||
|
|
||||||
local function create_world_formspec(dialogdata)
|
local function create_world_formspec(dialogdata)
|
||||||
|
|
||||||
local current_mg = dialogdata.mg or core.settings:get("mg_name")
|
local current_mg = dialogdata.mg
|
||||||
local mapgens = core.get_mapgen_names()
|
local mapgens = core.get_mapgen_names()
|
||||||
|
|
||||||
local flags = dialogdata.flags
|
local flags = dialogdata.flags
|
||||||
|
@ -90,16 +90,15 @@ local function create_world_formspec(dialogdata)
|
||||||
-- should never happen but just pick the first game
|
-- should never happen but just pick the first game
|
||||||
game = pkgmgr.games[1]
|
game = pkgmgr.games[1]
|
||||||
core.settings:set("menu_last_game", game.id)
|
core.settings:set("menu_last_game", game.id)
|
||||||
|
|
||||||
|
current_mg = dialogdata.mg or core.settings:get("mg_name")
|
||||||
end
|
end
|
||||||
|
|
||||||
local disallowed_mapgen_settings = {}
|
local disallowed_mapgen_settings = {}
|
||||||
if game ~= nil then
|
if game ~= nil then
|
||||||
local gameconfig = Settings(game.path.."/game.conf")
|
local gameconfig = Settings(game.path.."/game.conf")
|
||||||
|
|
||||||
local game_default_mg = gameconfig:get("default_mapgen")
|
current_mg = current_mg or gameconfig:get("default_mapgen") or core.settings:get("mg_name")
|
||||||
if dialogdata.mg == nil and game_default_mg then
|
|
||||||
current_mg = game_default_mg
|
|
||||||
end
|
|
||||||
|
|
||||||
local allowed_mapgens = (gameconfig:get("allowed_mapgens") or ""):split()
|
local allowed_mapgens = (gameconfig:get("allowed_mapgens") or ""):split()
|
||||||
for key, value in pairs(allowed_mapgens) do
|
for key, value in pairs(allowed_mapgens) do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue