From 0a299fd4e5dff20bb09f54f2329aedcc8d22ef9d Mon Sep 17 00:00:00 2001 From: fz72 Date: Tue, 17 Feb 2015 16:53:49 +0100 Subject: [PATCH] Fix map_seed not changed when creating a new world after login to another --- builtin/mainmenu/dlg_create_world.lua | 4 ++-- src/emerge.cpp | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/builtin/mainmenu/dlg_create_world.lua b/builtin/mainmenu/dlg_create_world.lua index 32e1fbf83..b42d119e0 100644 --- a/builtin/mainmenu/dlg_create_world.lua +++ b/builtin/mainmenu/dlg_create_world.lua @@ -90,6 +90,8 @@ local function create_world_buttonhandler(this, fields) local message = nil + core.setting_set("fixed_map_seed", fields["te_seed"]) + if not menudata.worldlist:uid_exists_raw(worldname) then core.setting_set("mg_name",fields["dd_mapgen"]) message = core.create_world(worldname,gameindex) @@ -97,8 +99,6 @@ local function create_world_buttonhandler(this, fields) message = fgettext("A world named \"$1\" already exists", worldname) end - core.setting_set("fixed_map_seed", fields["te_seed"]) - if message ~= nil then gamedata.errormessage = message else diff --git a/src/emerge.cpp b/src/emerge.cpp index c485caffa..a697bcb07 100644 --- a/src/emerge.cpp +++ b/src/emerge.cpp @@ -361,7 +361,10 @@ void EmergeManager::loadParamsFromSettings(Settings *settings) std::string seed_str; const char *setname = (settings == g_settings) ? "fixed_map_seed" : "seed"; - if (settings->getNoEx(setname, seed_str) && !seed_str.empty()) { + if (!settings->getNoEx("seed", seed_str)) { + g_settings->getNoEx(setname, seed_str); + } + if (!seed_str.empty()) { params.seed = read_seed(seed_str.c_str()); } else { params.seed =