aboutsummaryrefslogtreecommitdiff
path: root/src/server.cpp
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2014-12-29 12:58:55 -0500
committerkwolekr <kwolekr@minetest.net>2014-12-29 12:59:59 -0500
commit5e2753c712e8f65fa50f4889fc1422393ba21413 (patch)
tree04aab9306f77497e712ad13ae3445d878280881d /src/server.cpp
parentff3cfb746e203ed02160de09b1912b543c5a25f0 (diff)
downloadminetest-5e2753c712e8f65fa50f4889fc1422393ba21413.tar.gz
minetest-5e2753c712e8f65fa50f4889fc1422393ba21413.tar.bz2
minetest-5e2753c712e8f65fa50f4889fc1422393ba21413.zip
Expose mapgen parameters on scripting init
Add minetest.get_mapgen_params() Deprecate minetest.register_on_mapgen_init()
Diffstat (limited to 'src/server.cpp')
-rw-r--r--src/server.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/server.cpp b/src/server.cpp
index a52cd639d..07f808202 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -295,6 +295,10 @@ Server::Server(
// Lock environment
JMutexAutoLock envlock(m_env_mutex);
+ // Create the Map and load parameters
+ ServerMap *servermap = new ServerMap(path_world, this, m_emerge);
+ m_emerge->loadMapgenParams();
+
// Initialize scripting
infostream<<"Server: Initializing Lua"<<std::endl;
@@ -302,10 +306,8 @@ Server::Server(
std::string scriptpath = getBuiltinLuaPath() + DIR_DELIM "init.lua";
- if (!m_script->loadScript(scriptpath)) {
+ if (!m_script->loadScript(scriptpath))
throw ModError("Failed to load and run " + scriptpath);
- }
-
// Print 'em
infostream<<"Server: Loading mods: ";
@@ -339,19 +341,11 @@ Server::Server(
// Perform pending node name resolutions
m_nodedef->runNodeResolverCallbacks();
- // Load the mapgen params from global settings now after any
- // initial overrides have been set by the mods
- m_emerge->loadMapgenParams();
-
// Initialize Environment
- ServerMap *servermap = new ServerMap(path_world, this, m_emerge);
m_env = new ServerEnvironment(servermap, m_script, this, m_path_world);
m_clients.setEnv(m_env);
- // Run some callbacks after the MG params have been set up but before activation
- m_script->environment_OnMapgenInit(&m_emerge->params);
-
// Initialize mapgens
m_emerge->initMapgens();