Skip to content

Commit 22730bb

Browse files
committedMar 18, 2015
Mgv6: Remove addDirtGravelBlobs, replaced by blob ore in Minetest Game
Desert stone above y = -32 not water_level Remove unused generateExperimental()
1 parent 8ca08a8 commit 22730bb

File tree

2 files changed

+4
-48
lines changed

2 files changed

+4
-48
lines changed
 

Diff for: ‎src/mapgen_v6.cpp

+3-46
Original file line numberDiff line numberDiff line change
@@ -477,8 +477,6 @@ void MapgenV6::makeChunk(BlockMakeData *data)
477477
// Generate general ground level to full area
478478
stone_surface_max_y = generateGround();
479479

480-
generateExperimental();
481-
482480
// Create initial heightmap to limit caves
483481
updateHeightmap(node_min, node_max);
484482

@@ -497,9 +495,6 @@ void MapgenV6::makeChunk(BlockMakeData *data)
497495
// Add mud to the central chunk
498496
addMud();
499497

500-
// Add blobs of dirt and gravel underground
501-
addDirtGravelBlobs();
502-
503498
// Flow mud away from steep edges
504499
if (spflags & MGV6_MUDFLOW)
505500
flowMud(mudflow_minpos, mudflow_maxpos);
@@ -610,7 +605,8 @@ int MapgenV6::generateGround()
610605
for (s16 y = node_min.Y; y <= node_max.Y; y++) {
611606
if (vm->m_data[i].getContent() == CONTENT_IGNORE) {
612607
if (y <= surface_y) {
613-
vm->m_data[i] = (y > water_level && bt == BT_DESERT) ?
608+
vm->m_data[i] = (y >= DESERT_STONE_BASE
609+
&& bt == BT_DESERT) ?
614610
n_desert_stone : n_stone;
615611
} else if (y <= water_level) {
616612
vm->m_data[i] = n_water_source;
@@ -823,45 +819,6 @@ void MapgenV6::flowMud(s16 &mudflow_minpos, s16 &mudflow_maxpos)
823819
}
824820

825821

826-
void MapgenV6::addDirtGravelBlobs()
827-
{
828-
if (getBiome(v2s16(node_min.X, node_min.Z)) != BT_NORMAL)
829-
return;
830-
831-
PseudoRandom pr(blockseed + 983);
832-
for (int i = 0; i < volume_nodes/10/10/10; i++) {
833-
bool only_fill_cave = (myrand_range(0,1) != 0);
834-
v3s16 size(
835-
pr.range(1, 8),
836-
pr.range(1, 8),
837-
pr.range(1, 8)
838-
);
839-
v3s16 p0(
840-
pr.range(node_min.X, node_max.X) - size.X / 2,
841-
pr.range(node_min.Y, node_max.Y) - size.Y / 2,
842-
pr.range(node_min.Z, node_max.Z) - size.Z / 2
843-
);
844-
845-
MapNode n1((p0.Y > -32 && !pr.range(0, 1)) ? c_dirt : c_gravel);
846-
for (int z1 = 0; z1 < size.Z; z1++)
847-
for (int y1 = 0; y1 < size.Y; y1++)
848-
for (int x1 = 0; x1 < size.X; x1++) {
849-
v3s16 p = p0 + v3s16(x1, y1, z1);
850-
u32 i = vm->m_area.index(p);
851-
if (!vm->m_area.contains(i))
852-
continue;
853-
// Cancel if not stone and not cave air
854-
if (vm->m_data[i].getContent() != c_stone &&
855-
!(vm->m_flags[i] & VMANIP_FLAG_CAVE))
856-
continue;
857-
if (only_fill_cave && !(vm->m_flags[i] & VMANIP_FLAG_CAVE))
858-
continue;
859-
vm->m_data[i] = n1;
860-
}
861-
}
862-
}
863-
864-
865822
void MapgenV6::placeTreesAndJungleGrass()
866823
{
867824
//TimeTaker t("placeTrees");
@@ -960,7 +917,7 @@ void MapgenV6::placeTreesAndJungleGrass()
960917
treegen::make_jungletree(*vm, p, ndef, myrand());
961918
} else {
962919
bool is_apple_tree = (myrand_range(0, 3) == 0) &&
963-
getHaveAppleTree(v2s16(x, z));
920+
getHaveAppleTree(v2s16(x, z));
964921
treegen::make_tree(*vm, p, is_apple_tree, ndef, myrand());
965922
}
966923
}

Diff for: ‎src/mapgen_v6.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
2424
#include "noise.h"
2525

2626
#define AVERAGE_MUD_AMOUNT 4
27+
#define DESERT_STONE_BASE -32
2728

2829
/////////////////// Mapgen V6 flags
2930
#define MGV6_JUNGLES 0x01
@@ -139,11 +140,9 @@ class MapgenV6 : public Mapgen {
139140
int generateGround();
140141
void addMud();
141142
void flowMud(s16 &mudflow_minpos, s16 &mudflow_maxpos);
142-
void addDirtGravelBlobs();
143143
void growGrass();
144144
void placeTreesAndJungleGrass();
145145
virtual void generateCaves(int max_stone_y);
146-
virtual void generateExperimental() {}
147146
};
148147

149148
struct MapgenFactoryV6 : public MapgenFactory {

0 commit comments

Comments
 (0)
Please sign in to comment.