aboutsummaryrefslogtreecommitdiff
path: root/src/mapgen
diff options
context:
space:
mode:
authorParamat <paramat@users.noreply.github.com>2020-09-03 01:28:40 +0100
committerGitHub <noreply@github.com>2020-09-03 01:28:40 +0100
commit4ba5046308d6bdf7b38394770c6f82b6927393f2 (patch)
tree835812e435c2bfbb3656ad0b6226af3e979718ae /src/mapgen
parent74e22b72e1fc577d05ea703aed4bfa8c1e1f0599 (diff)
downloadminetest-4ba5046308d6bdf7b38394770c6f82b6927393f2.tar.gz
minetest-4ba5046308d6bdf7b38394770c6f82b6927393f2.tar.bz2
minetest-4ba5046308d6bdf7b38394770c6f82b6927393f2.zip
Add 'ores' global mapgen flag (#10276)
Diffstat (limited to 'src/mapgen')
-rw-r--r--src/mapgen/mapgen.cpp3
-rw-r--r--src/mapgen/mapgen.h1
-rw-r--r--src/mapgen/mapgen_carpathian.cpp3
-rw-r--r--src/mapgen/mapgen_flat.cpp3
-rw-r--r--src/mapgen/mapgen_fractal.cpp3
-rw-r--r--src/mapgen/mapgen_v5.cpp3
-rw-r--r--src/mapgen/mapgen_v6.cpp3
-rw-r--r--src/mapgen/mapgen_v7.cpp3
-rw-r--r--src/mapgen/mapgen_valleys.cpp3
9 files changed, 17 insertions, 8 deletions
diff --git a/src/mapgen/mapgen.cpp b/src/mapgen/mapgen.cpp
index f57529082..52ef64e7e 100644
--- a/src/mapgen/mapgen.cpp
+++ b/src/mapgen/mapgen.cpp
@@ -58,6 +58,7 @@ FlagDesc flagdesc_mapgen[] = {
{"light", MG_LIGHT},
{"decorations", MG_DECORATIONS},
{"biomes", MG_BIOMES},
+ {"ores", MG_ORES},
{NULL, 0}
};
@@ -217,7 +218,7 @@ void Mapgen::getMapgenNames(std::vector<const char *> *mgnames, bool include_hid
void Mapgen::setDefaultSettings(Settings *settings)
{
settings->setDefault("mg_flags", flagdesc_mapgen,
- MG_CAVES | MG_DUNGEONS | MG_LIGHT | MG_DECORATIONS | MG_BIOMES);
+ MG_CAVES | MG_DUNGEONS | MG_LIGHT | MG_DECORATIONS | MG_BIOMES | MG_ORES);
for (int i = 0; i < (int)MAPGEN_INVALID; ++i) {
MapgenParams *params = createMapgenParams((MapgenType)i);
diff --git a/src/mapgen/mapgen.h b/src/mapgen/mapgen.h
index a92b3b0d0..0f2977c4c 100644
--- a/src/mapgen/mapgen.h
+++ b/src/mapgen/mapgen.h
@@ -37,6 +37,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#define MG_LIGHT 0x10
#define MG_DECORATIONS 0x20
#define MG_BIOMES 0x40
+#define MG_ORES 0x80
typedef u16 biome_t; // copy from mg_biome.h to avoid an unnecessary include
diff --git a/src/mapgen/mapgen_carpathian.cpp b/src/mapgen/mapgen_carpathian.cpp
index feb9b428c..74ed263ba 100644
--- a/src/mapgen/mapgen_carpathian.cpp
+++ b/src/mapgen/mapgen_carpathian.cpp
@@ -315,7 +315,8 @@ void MapgenCarpathian::makeChunk(BlockMakeData *data)
}
// Generate the registered ores
- m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
+ if (flags & MG_ORES)
+ m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
// Generate dungeons
if (flags & MG_DUNGEONS)
diff --git a/src/mapgen/mapgen_flat.cpp b/src/mapgen/mapgen_flat.cpp
index df6469ad9..d62548014 100644
--- a/src/mapgen/mapgen_flat.cpp
+++ b/src/mapgen/mapgen_flat.cpp
@@ -264,7 +264,8 @@ void MapgenFlat::makeChunk(BlockMakeData *data)
}
// Generate the registered ores
- m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
+ if (flags & MG_ORES)
+ m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
if (flags & MG_DUNGEONS)
generateDungeons(stone_surface_max_y);
diff --git a/src/mapgen/mapgen_fractal.cpp b/src/mapgen/mapgen_fractal.cpp
index cb55bc288..3b6bbd6c1 100644
--- a/src/mapgen/mapgen_fractal.cpp
+++ b/src/mapgen/mapgen_fractal.cpp
@@ -250,7 +250,8 @@ void MapgenFractal::makeChunk(BlockMakeData *data)
}
// Generate the registered ores
- m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
+ if (flags & MG_ORES)
+ m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
// Generate dungeons
if (flags & MG_DUNGEONS)
diff --git a/src/mapgen/mapgen_v5.cpp b/src/mapgen/mapgen_v5.cpp
index 124667e5d..0f6a19fa1 100644
--- a/src/mapgen/mapgen_v5.cpp
+++ b/src/mapgen/mapgen_v5.cpp
@@ -257,7 +257,8 @@ void MapgenV5::makeChunk(BlockMakeData *data)
}
// Generate the registered ores
- m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
+ if (flags & MG_ORES)
+ m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
// Generate dungeons and desert temples
if (flags & MG_DUNGEONS)
diff --git a/src/mapgen/mapgen_v6.cpp b/src/mapgen/mapgen_v6.cpp
index e9692246c..8bea5eb69 100644
--- a/src/mapgen/mapgen_v6.cpp
+++ b/src/mapgen/mapgen_v6.cpp
@@ -652,7 +652,8 @@ void MapgenV6::makeChunk(BlockMakeData *data)
m_emerge->decomgr->placeAllDecos(this, blockseed, node_min, node_max);
// Generate the registered ores
- m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
+ if (flags & MG_ORES)
+ m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
// Calculate lighting
if (flags & MG_LIGHT)
diff --git a/src/mapgen/mapgen_v7.cpp b/src/mapgen/mapgen_v7.cpp
index e93dc9140..a1fe25ab6 100644
--- a/src/mapgen/mapgen_v7.cpp
+++ b/src/mapgen/mapgen_v7.cpp
@@ -377,7 +377,8 @@ void MapgenV7::makeChunk(BlockMakeData *data)
}
// Generate the registered ores
- m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
+ if (flags & MG_ORES)
+ m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
// Generate dungeons
if (flags & MG_DUNGEONS)
diff --git a/src/mapgen/mapgen_valleys.cpp b/src/mapgen/mapgen_valleys.cpp
index efcc8ee85..d7b6f738f 100644
--- a/src/mapgen/mapgen_valleys.cpp
+++ b/src/mapgen/mapgen_valleys.cpp
@@ -268,7 +268,8 @@ void MapgenValleys::makeChunk(BlockMakeData *data)
}
// Generate the registered ores
- m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
+ if (flags & MG_ORES)
+ m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
// Dungeon creation
if (flags & MG_DUNGEONS)