mapgen: Fix segfault when selecting invalid mapgen (#5491)
parent
a4874270f7
commit
773efc19b1
|
@ -1003,8 +1003,11 @@ void MapgenParams::readParams(const Settings *settings)
|
|||
}
|
||||
|
||||
std::string mg_name;
|
||||
if (settings->getNoEx("mg_name", mg_name))
|
||||
this->mgtype = Mapgen::getMapgenType(mg_name);
|
||||
if (settings->getNoEx("mg_name", mg_name)) {
|
||||
mgtype = Mapgen::getMapgenType(mg_name);
|
||||
if (mgtype == MAPGEN_INVALID)
|
||||
mgtype = MAPGEN_DEFAULT;
|
||||
}
|
||||
|
||||
settings->getS16NoEx("water_level", water_level);
|
||||
settings->getS16NoEx("mapgen_limit", mapgen_limit);
|
||||
|
|
Loading…
Reference in New Issue