1
0
mirror of https://github.com/moparisthebest/minetest synced 2024-12-23 08:08:47 -05:00

Fix crash on creating map with invalid mg_name

This commit is contained in:
kwolekr 2013-04-07 01:50:20 -04:00
parent fbf76184f0
commit 5961106f9f

View File

@ -243,6 +243,8 @@ MapgenParams *EmergeManager::createMapgenParams(std::string mgname) {
MapgenParams *EmergeManager::getParamsFromSettings(Settings *settings) { MapgenParams *EmergeManager::getParamsFromSettings(Settings *settings) {
std::string mg_name = settings->get("mg_name"); std::string mg_name = settings->get("mg_name");
MapgenParams *mgparams = createMapgenParams(mg_name); MapgenParams *mgparams = createMapgenParams(mg_name);
if (!mgparams)
return NULL;
mgparams->mg_name = mg_name; mgparams->mg_name = mg_name;
mgparams->seed = settings->getU64(settings == g_settings ? "fixed_map_seed" : "seed"); mgparams->seed = settings->getU64(settings == g_settings ? "fixed_map_seed" : "seed");