]> git.lizzy.rs Git - minetest.git/blobdiff - src/content/subgames.cpp
Translated using Weblate (French)
[minetest.git] / src / content / subgames.cpp
index e834f40cd355c29e22d31866c27dcd299261f0a6..62e82e0e4a29235a255460213c5ff25dee3821f9 100644 (file)
@@ -24,7 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "log.h"
 #include "util/strfnd.h"
 #include "defaultsettings.h" // for set_default_settings
-#include "mapgen/mapgen.h"   // for MapgenParams
+#include "map_settings_manager.h"
 #include "util/string.h"
 
 #ifndef SERVER
@@ -370,19 +370,12 @@ void loadGameConfAndInitWorld(const std::string &path, const std::string &name,
        // Create map_meta.txt if does not already exist
        std::string map_meta_path = final_path + DIR_DELIM + "map_meta.txt";
        if (!fs::PathExists(map_meta_path)) {
-               verbosestream << "Creating map_meta.txt (" << map_meta_path << ")"
-                             << std::endl;
-               std::ostringstream oss(std::ios_base::binary);
+               MapSettingsManager mgr(map_meta_path);
 
-               Settings conf;
-               MapgenParams params;
-
-               params.readParams(g_settings);
-               params.writeParams(&conf);
-               conf.writeLines(oss);
-               oss << "[end_of_params]\n";
+               mgr.setMapSetting("seed", g_settings->get("fixed_map_seed"));
 
-               fs::safeWriteToFile(map_meta_path, oss.str());
+               mgr.makeMapgenParams();
+               mgr.saveMapMeta();
        }
 
        // The Settings object is no longer needed for created worlds