From 453d79e3a201a4186dae386d0bce209f75be742c Mon Sep 17 00:00:00 2001
From: kwolekr <kwolekr@minetest.net>
Date: Sat, 6 Apr 2013 13:36:31 -0400
Subject: [PATCH] Don't re-write entire map_meta.txt if a setting is missing

---
 src/map.cpp | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/map.cpp b/src/map.cpp
index 39f5e30fb..c9f473dc2 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -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;
-- 
GitLab