Skip to content
Permalink
Browse files

mapgen: Fix segfault when selecting invalid mapgen (#5491)

  • Loading branch information...
SmallJoker authored and nerzhul committed Apr 1, 2017
1 parent a487427 commit 773efc19b1d05e573d5bc811c0175d192f7c12c5
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/mapgen.cpp
@@ -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);

0 comments on commit 773efc1

Please sign in to comment.
You can’t perform that action at this time.