Don't re-write entire map_meta.txt if a setting is missing
authorkwolekr <kwolekr@minetest.net>
Sat, 6 Apr 2013 17:36:31 +0000 (13:36 -0400)
committerkwolekr <kwolekr@minetest.net>
Sat, 6 Apr 2013 17:36:51 +0000 (13:36 -0400)
src/map.cpp

index 39f5e30fbef8e32de3b3cc5076e9b3dc162c29bd..c9f473dc2cb150b9c8d39b24fa85d1b905067f21 100644 (file)
@@ -3466,8 +3466,16 @@ void ServerMap::loadMapMeta()
                        break;
                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 (m_mgparams)
                        delete m_mgparams;