mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Add definable node_stone to biome API, mgv5, mgv7. Reduce and correct depth of mgv7 biomes. l_mapgen.cpp: add '#include mapgen_v5.h' because '#include mapgen_v7' is there. Improve underwater grass hack
This commit is contained in:
parent
fcb1ea903f
commit
0a5373d400
5 changed files with 40 additions and 16 deletions
|
@ -534,7 +534,7 @@ void MapgenV7::generateBiomes() {
|
|||
Biome *biome = (Biome *)bmgr->get(biomemap[index]);
|
||||
s16 dfiller = biome->depth_filler + noise_filler_depth->result[index];
|
||||
s16 y0_top = biome->depth_top;
|
||||
s16 y0_filler = biome->depth_filler + biome->depth_top + dfiller;
|
||||
s16 y0_filler = biome->depth_top + dfiller;
|
||||
|
||||
s16 nplaced = 0;
|
||||
u32 i = vm->m_area.index(x, node_max.Y, z);
|
||||
|
@ -560,22 +560,31 @@ void MapgenV7::generateBiomes() {
|
|||
|
||||
if (c_below != CONTENT_AIR) {
|
||||
if (nplaced < y0_top) {
|
||||
// A hack to prevent dirt_with_grass from being
|
||||
// placed below water. TODO: fix later
|
||||
content_t c_place = ((y < water_level) &&
|
||||
(biome->c_top == c_dirt_with_grass)) ?
|
||||
c_dirt : biome->c_top;
|
||||
|
||||
vm->m_data[i] = MapNode(c_place);
|
||||
if(y < water_level)
|
||||
vm->m_data[i] = MapNode(biome->c_filler);
|
||||
else
|
||||
vm->m_data[i] = MapNode(biome->c_top);
|
||||
nplaced++;
|
||||
} else if (nplaced < y0_filler && nplaced >= y0_top) {
|
||||
vm->m_data[i] = MapNode(biome->c_filler);
|
||||
nplaced++;
|
||||
} else if (c == c_stone) {
|
||||
have_air = false;
|
||||
nplaced = 0;
|
||||
vm->m_data[i] = MapNode(biome->c_stone);
|
||||
} else {
|
||||
have_air = false;
|
||||
nplaced = 0;
|
||||
}
|
||||
} else if (c == c_stone) {
|
||||
have_air = false;
|
||||
nplaced = 0;
|
||||
vm->m_data[i] = MapNode(biome->c_stone);
|
||||
}
|
||||
} else if (c == c_stone) {
|
||||
have_air = false;
|
||||
nplaced = 0;
|
||||
vm->m_data[i] = MapNode(biome->c_stone);
|
||||
} else if (c == c_water_source) {
|
||||
have_air = true;
|
||||
nplaced = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue