Skip to content

Commit 4ba5046

Browse files
authoredSep 3, 2020
Add 'ores' global mapgen flag (#10276)
1 parent 74e22b7 commit 4ba5046

10 files changed

+18
-9
lines changed
 

Diff for: ‎builtin/settingtypes.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1475,7 +1475,7 @@ mapgen_limit (Map generation limit) int 31000 0 31000
14751475
# Global map generation attributes.
14761476
# In Mapgen v6 the 'decorations' flag controls all decorations except trees
14771477
# and junglegrass, in all other mapgens this flag controls all decorations.
1478-
mg_flags (Mapgen flags) flags caves,dungeons,light,decorations,biomes caves,dungeons,light,decorations,biomes,nocaves,nodungeons,nolight,nodecorations,nobiomes
1478+
mg_flags (Mapgen flags) flags caves,dungeons,light,decorations,biomes,ores caves,dungeons,light,decorations,biomes,ores,nocaves,nodungeons,nolight,nodecorations,nobiomes,noores
14791479

14801480
[*Biome API temperature and humidity noise parameters]
14811481

Diff for: ‎src/mapgen/mapgen.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ FlagDesc flagdesc_mapgen[] = {
5858
{"light", MG_LIGHT},
5959
{"decorations", MG_DECORATIONS},
6060
{"biomes", MG_BIOMES},
61+
{"ores", MG_ORES},
6162
{NULL, 0}
6263
};
6364

@@ -217,7 +218,7 @@ void Mapgen::getMapgenNames(std::vector<const char *> *mgnames, bool include_hid
217218
void Mapgen::setDefaultSettings(Settings *settings)
218219
{
219220
settings->setDefault("mg_flags", flagdesc_mapgen,
220-
MG_CAVES | MG_DUNGEONS | MG_LIGHT | MG_DECORATIONS | MG_BIOMES);
221+
MG_CAVES | MG_DUNGEONS | MG_LIGHT | MG_DECORATIONS | MG_BIOMES | MG_ORES);
221222

222223
for (int i = 0; i < (int)MAPGEN_INVALID; ++i) {
223224
MapgenParams *params = createMapgenParams((MapgenType)i);

Diff for: ‎src/mapgen/mapgen.h

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
3737
#define MG_LIGHT 0x10
3838
#define MG_DECORATIONS 0x20
3939
#define MG_BIOMES 0x40
40+
#define MG_ORES 0x80
4041

4142
typedef u16 biome_t; // copy from mg_biome.h to avoid an unnecessary include
4243

Diff for: ‎src/mapgen/mapgen_carpathian.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,8 @@ void MapgenCarpathian::makeChunk(BlockMakeData *data)
315315
}
316316

317317
// Generate the registered ores
318-
m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
318+
if (flags & MG_ORES)
319+
m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
319320

320321
// Generate dungeons
321322
if (flags & MG_DUNGEONS)

Diff for: ‎src/mapgen/mapgen_flat.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,8 @@ void MapgenFlat::makeChunk(BlockMakeData *data)
264264
}
265265

266266
// Generate the registered ores
267-
m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
267+
if (flags & MG_ORES)
268+
m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
268269

269270
if (flags & MG_DUNGEONS)
270271
generateDungeons(stone_surface_max_y);

Diff for: ‎src/mapgen/mapgen_fractal.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,8 @@ void MapgenFractal::makeChunk(BlockMakeData *data)
250250
}
251251

252252
// Generate the registered ores
253-
m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
253+
if (flags & MG_ORES)
254+
m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
254255

255256
// Generate dungeons
256257
if (flags & MG_DUNGEONS)

Diff for: ‎src/mapgen/mapgen_v5.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,8 @@ void MapgenV5::makeChunk(BlockMakeData *data)
257257
}
258258

259259
// Generate the registered ores
260-
m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
260+
if (flags & MG_ORES)
261+
m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
261262

262263
// Generate dungeons and desert temples
263264
if (flags & MG_DUNGEONS)

Diff for: ‎src/mapgen/mapgen_v6.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,8 @@ void MapgenV6::makeChunk(BlockMakeData *data)
652652
m_emerge->decomgr->placeAllDecos(this, blockseed, node_min, node_max);
653653

654654
// Generate the registered ores
655-
m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
655+
if (flags & MG_ORES)
656+
m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
656657

657658
// Calculate lighting
658659
if (flags & MG_LIGHT)

Diff for: ‎src/mapgen/mapgen_v7.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,8 @@ void MapgenV7::makeChunk(BlockMakeData *data)
377377
}
378378

379379
// Generate the registered ores
380-
m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
380+
if (flags & MG_ORES)
381+
m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
381382

382383
// Generate dungeons
383384
if (flags & MG_DUNGEONS)

Diff for: ‎src/mapgen/mapgen_valleys.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,8 @@ void MapgenValleys::makeChunk(BlockMakeData *data)
268268
}
269269

270270
// Generate the registered ores
271-
m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
271+
if (flags & MG_ORES)
272+
m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
272273

273274
// Dungeon creation
274275
if (flags & MG_DUNGEONS)

0 commit comments

Comments
 (0)