Skip to content

Commit

Permalink
Fix map_seed not changed when creating a new world after login to ano…
Browse files Browse the repository at this point in the history
…ther
  • Loading branch information
fz72 authored and nerzhul committed Feb 18, 2015
1 parent 2079462 commit 0a299fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions builtin/mainmenu/dlg_create_world.lua
Expand Up @@ -90,15 +90,15 @@ 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)
else
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
Expand Down
5 changes: 4 additions & 1 deletion src/emerge.cpp
Expand Up @@ -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 =
Expand Down

0 comments on commit 0a299fd

Please sign in to comment.