Update mapgen params in ServerMap after Mapgen init
authorkwolekr <kwolekr@minetest.net>
Sat, 14 Dec 2013 15:49:20 +0000 (10:49 -0500)
committerkwolekr <kwolekr@minetest.net>
Sat, 14 Dec 2013 15:49:20 +0000 (10:49 -0500)
src/emerge.cpp
src/map.h
src/server.cpp

index 2f757a760e3183c655f99684f5c7b1aa36c7c990..6635a6518b26fc2bb70efac60a0df0bf6109dd68 100644 (file)
@@ -91,11 +91,11 @@ public:
 
 EmergeManager::EmergeManager(IGameDef *gamedef) {
        //register built-in mapgens
-       registerMapgen("v6", new MapgenFactoryV6());
-       registerMapgen("v7", new MapgenFactoryV7());
-       registerMapgen("indev", new MapgenFactoryIndev());
+       registerMapgen("v6",         new MapgenFactoryV6());
+       registerMapgen("v7",         new MapgenFactoryV7());
+       registerMapgen("indev",      new MapgenFactoryIndev());
        registerMapgen("singlenode", new MapgenFactorySinglenode());
-       registerMapgen("math", new MapgenFactoryMath());
+       registerMapgen("math",       new MapgenFactoryMath());
 
        this->ndef     = gamedef->getNodeDefManager();
        this->biomedef = new BiomeDefManager();
index d4656acc603d0846152c0fa0df3fc891cfdcdd77..fa88109a3a57e2a16823af2a2cfa130a3068b3ef 100644 (file)
--- a/src/map.h
+++ b/src/map.h
@@ -496,6 +496,7 @@ public:
        u64 getSeed(){ return m_seed; }
 
        MapgenParams *getMapgenParams(){ return m_mgparams; }
+       void setMapgenParams(MapgenParams *mgparams){ m_mgparams = mgparams; }
 
        // Parameters fed to the Mapgen
        MapgenParams *m_mgparams;
index 9d51b794b8a80e53dc0ade915d651fe237b7bdeb..1455de721767fd461a566d475a94759d8c476bbb 100644 (file)
@@ -823,6 +823,7 @@ Server::Server(
        
        // Initialize mapgens
        m_emerge->initMapgens(mgparams);
+       servermap->setMapgenParams(m_emerge->params);
 
        // Give environment reference to scripting api
        m_script->initializeEnvironment(m_env);