Don't re-write entire map_meta.txt if a setting is missing

master
kwolekr 2013-04-06 13:36:31 -04:00
parent 046534e14b
commit 453d79e3a2
1 changed files with 10 additions and 2 deletions

View File

@ -3466,8 +3466,16 @@ void ServerMap::loadMapMeta()
break; break;
params.parseConfigLine(line); params.parseConfigLine(line);
} }
MapgenParams *mgparams = m_emerge->getParamsFromSettings(&params); MapgenParams *mgparams;
try {
mgparams = m_emerge->getParamsFromSettings(&params);
} catch (SettingNotFoundException &e) {
infostream << "Couldn't get a setting from map_meta.txt: "
<< e.what() << std::endl;
mgparams = NULL;
}
if (mgparams) { if (mgparams) {
if (m_mgparams) if (m_mgparams)
delete m_mgparams; delete m_mgparams;