Fix mapgen settings in minetest.conf being ignored (#9737)
authorsfan5 <sfan5@live.de>
Sun, 26 Apr 2020 17:32:29 +0000 (19:32 +0200)
committerGitHub <noreply@github.com>
Sun, 26 Apr 2020 17:32:29 +0000 (19:32 +0200)
broken since e8a8185d24897ccf964327017effae81aa1c9d40

src/map_settings_manager.cpp

index 7ef4bf12e30e160caf69bff7b42e64918d816db7..4f070e910fcff6e1cb698cd399fb04a1ee9d0af9 100644 (file)
@@ -32,7 +32,6 @@ MapSettingsManager::MapSettingsManager(Settings *user_settings,
        m_user_settings(user_settings)
 {
        assert(m_user_settings != NULL);
-       Mapgen::setDefaultSettings(m_map_settings);
 }
 
 
@@ -180,6 +179,16 @@ MapgenParams *MapSettingsManager::makeMapgenParams()
 
        params->mgtype = mgtype;
 
+       // Load the mapgen param defaults
+       /* FIXME: Why is it done like this? MapgenParams should just
+        * set the defaults in its constructor instead. */
+       {
+               Settings default_settings;
+               Mapgen::setDefaultSettings(&default_settings);
+               params->MapgenParams::readParams(&default_settings);
+               params->readParams(&default_settings);
+       }
+
        // Load the rest of the mapgen params from our active settings
        params->MapgenParams::readParams(m_user_settings);
        params->MapgenParams::readParams(m_map_settings);