1
0
Fork 0
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:
Xeno333 2025-07-18 16:44:14 -05:00 committed by GitHub
parent 7d075d4fcb
commit cf5b57a977
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -80,7 +80,7 @@ local mgv6_biomes = {
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 flags = dialogdata.flags
@ -90,16 +90,15 @@ local function create_world_formspec(dialogdata)
-- should never happen but just pick the first game
game = pkgmgr.games[1]
core.settings:set("menu_last_game", game.id)
current_mg = dialogdata.mg or core.settings:get("mg_name")
end
local disallowed_mapgen_settings = {}
if game ~= nil then
local gameconfig = Settings(game.path.."/game.conf")
local game_default_mg = gameconfig:get("default_mapgen")
if dialogdata.mg == nil and game_default_mg then
current_mg = game_default_mg
end
current_mg = current_mg or gameconfig:get("default_mapgen") or core.settings:get("mg_name")
local allowed_mapgens = (gameconfig:get("allowed_mapgens") or ""):split()
for key, value in pairs(allowed_mapgens) do