aboutsummaryrefslogtreecommitdiff
path: root/src/server.cpp
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2013-06-27 17:06:52 -0400
committerkwolekr <kwolekr@minetest.net>2013-06-27 22:35:35 -0400
commit2e292b67a0a02b045969034c06aaf92b42a83a81 (patch)
tree499310d109cbd737633eb99a245e0054a0c458d7 /src/server.cpp
parent18882a4d2603488bdfb5a519a8bedf300b154940 (diff)
downloadminetest-2e292b67a0a02b045969034c06aaf92b42a83a81.tar.gz
minetest-2e292b67a0a02b045969034c06aaf92b42a83a81.tar.bz2
minetest-2e292b67a0a02b045969034c06aaf92b42a83a81.zip
Add Lua on_mapgen_init callback, and minetest.set_mapgen_params API
Diffstat (limited to 'src/server.cpp')
-rw-r--r--src/server.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/server.cpp b/src/server.cpp
index 016922103..1618a0915 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -807,7 +807,12 @@ Server::Server(
ServerMap *servermap = new ServerMap(path_world, this, m_emerge);
m_env = new ServerEnvironment(servermap, m_script, this, this);
- m_emerge->initMapgens(servermap->getMapgenParams());
+ // Run some callbacks after the MG params have been set up but before activation
+ MapgenParams *mgparams = servermap->getMapgenParams();
+ m_script->environment_OnMapgenInit(mgparams);
+
+ // Initialize mapgens
+ m_emerge->initMapgens(mgparams);
// Give environment reference to scripting api
m_script->initializeEnvironment(m_env);