mirror of
				https://github.com/luanti-org/luanti.git
				synced 2025-10-30 23:15:32 +01:00 
			
		
		
		
	Fix map_seed not changed when creating a new world after login to another
This commit is contained in:
		| @@ -90,6 +90,8 @@ local function create_world_buttonhandler(this, fields) | |||||||
|  |  | ||||||
| 			local message = nil | 			local message = nil | ||||||
|  |  | ||||||
|  | 			core.setting_set("fixed_map_seed", fields["te_seed"]) | ||||||
|  |  | ||||||
| 			if not menudata.worldlist:uid_exists_raw(worldname) then | 			if not menudata.worldlist:uid_exists_raw(worldname) then | ||||||
| 				core.setting_set("mg_name",fields["dd_mapgen"]) | 				core.setting_set("mg_name",fields["dd_mapgen"]) | ||||||
| 				message = core.create_world(worldname,gameindex) | 				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) | 				message = fgettext("A world named \"$1\" already exists", worldname) | ||||||
| 			end | 			end | ||||||
|  |  | ||||||
| 			core.setting_set("fixed_map_seed", fields["te_seed"]) |  | ||||||
|  |  | ||||||
| 			if message ~= nil then | 			if message ~= nil then | ||||||
| 				gamedata.errormessage = message | 				gamedata.errormessage = message | ||||||
| 			else | 			else | ||||||
|   | |||||||
| @@ -361,7 +361,10 @@ void EmergeManager::loadParamsFromSettings(Settings *settings) | |||||||
| 	std::string seed_str; | 	std::string seed_str; | ||||||
| 	const char *setname = (settings == g_settings) ? "fixed_map_seed" : "seed"; | 	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()); | 		params.seed = read_seed(seed_str.c_str()); | ||||||
| 	} else { | 	} else { | ||||||
| 		params.seed = | 		params.seed = | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user