summaryrefslogtreecommitdiff
path: root/src/emerge.cpp
diff options
context:
space:
mode:
authorWeblate <42@minetest.ru>2013-04-07 13:39:28 +0200
committerWeblate <42@minetest.ru>2013-04-07 13:39:28 +0200
commitfeb7de91ec34ef1ca3152270a7bc62b2e308f1bd (patch)
tree65c33378bae9b7ac565b979237b6d594b511171f /src/emerge.cpp
parent33052abf42886ef03c4f46196cab6f767259a672 (diff)
parent4468ea84e6d0faede5a01e8d97d359c537aa7ec8 (diff)
downloadminetest-feb7de91ec34ef1ca3152270a7bc62b2e308f1bd.tar.gz
minetest-feb7de91ec34ef1ca3152270a7bc62b2e308f1bd.tar.bz2
minetest-feb7de91ec34ef1ca3152270a7bc62b2e308f1bd.zip
Merge remote branch 'origin/master'
Diffstat (limited to 'src/emerge.cpp')
-rw-r--r--src/emerge.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/emerge.cpp b/src/emerge.cpp
index e4bd997cb..499aaf291 100644
--- a/src/emerge.cpp
+++ b/src/emerge.cpp
@@ -1,6 +1,7 @@
/*
-Minetest-c55
-Copyright (C) 2010-2011 celeron55, Perttu Ahola <celeron55@gmail.com>
+Minetest
+Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
+Copyright (C) 2010-2013 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@@ -39,19 +40,22 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "biome.h"
#include "emerge.h"
#include "mapgen_v6.h"
+#include "mapgen_v7.h"
#include "mapgen_indev.h"
#include "mapgen_singlenode.h"
/////////////////////////////// Emerge Manager ////////////////////////////////
-EmergeManager::EmergeManager(IGameDef *gamedef, BiomeDefManager *bdef) {
+EmergeManager::EmergeManager(IGameDef *gamedef) {
//register built-in mapgens
registerMapgen("v6", new MapgenFactoryV6());
+ //registerMapgen("v7", new MapgenFactoryV7());
registerMapgen("indev", new MapgenFactoryIndev());
registerMapgen("singlenode", new MapgenFactorySinglenode());
- this->biomedef = bdef ? bdef : new BiomeDefManager(gamedef);
+ this->ndef = gamedef->getNodeDefManager();
+ this->biomedef = new BiomeDefManager();
this->params = NULL;
mapgen_debug_info = g_settings->getBool("enable_mapgen_debug_info");
@@ -104,6 +108,8 @@ void EmergeManager::initMapgens(MapgenParams *mgparams) {
if (mapgen.size())
return;
+ biomedef->resolveNodeNames(ndef);
+
this->params = mgparams;
for (unsigned int i = 0; i != emergethread.size(); i++) {
mg = createMapgen(params->mg_name, 0, params);
@@ -237,6 +243,8 @@ MapgenParams *EmergeManager::createMapgenParams(std::string mgname) {
MapgenParams *EmergeManager::getParamsFromSettings(Settings *settings) {
std::string mg_name = settings->get("mg_name");
MapgenParams *mgparams = createMapgenParams(mg_name);
+ if (!mgparams)
+ return NULL;
mgparams->mg_name = mg_name;
mgparams->seed = settings->getU64(settings == g_settings ? "fixed_map_seed" : "seed");