mirror of
https://github.com/minetest/minetest.git
synced 2024-11-30 11:33:44 +01:00
mapgen: Fix segfault when selecting invalid mapgen (#5491)
This commit is contained in:
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
Block a user