Re-add hacky fix for underwater grass, to fix mgv7 user's biomes

This commit is contained in:
paramat 2014-12-20 05:25:13 +00:00 committed by kwolekr
parent 1e8e700ee6
commit 173e1f6014
2 changed files with 24 additions and 20 deletions

@ -130,14 +130,14 @@ MapgenV5::~MapgenV5() {
MapgenV5Params::MapgenV5Params() { MapgenV5Params::MapgenV5Params() {
spflags = MGV5_BLOBS; spflags = MGV5_BLOBS;
np_filler_depth = NoiseParams(0, 1, v3f(150, 150, 150), 261, 4, 0.7, 2.0); np_filler_depth = NoiseParams(0, 1, v3f(150, 150, 150), 261, 4, 0.7, 2.0);
np_factor = NoiseParams(0, 1, v3f(250, 250, 250), 920381, 3, 0.45, 2.0); np_factor = NoiseParams(0, 1, v3f(250, 250, 250), 920381, 3, 0.45, 2.0);
np_height = NoiseParams(0, 10, v3f(250, 250, 250), 84174, 4, 0.5, 2.0); np_height = NoiseParams(0, 10, v3f(250, 250, 250), 84174, 4, 0.5, 2.0);
np_cave1 = NoiseParams(0, 6, v3f(50, 50, 50), 52534, 4, 0.5, 2.0, NOISE_FLAG_EASED); np_cave1 = NoiseParams(0, 6, v3f(50, 50, 50), 52534, 4, 0.5, 2.0, NOISE_FLAG_EASED);
np_cave2 = NoiseParams(0, 6, v3f(50, 50, 50), 10325, 4, 0.5, 2.0, NOISE_FLAG_EASED); np_cave2 = NoiseParams(0, 6, v3f(50, 50, 50), 10325, 4, 0.5, 2.0, NOISE_FLAG_EASED);
np_ground = NoiseParams(0, 40, v3f(80, 80, 80), 983240, 4, 0.55, 2.0, NOISE_FLAG_EASED); np_ground = NoiseParams(0, 40, v3f(80, 80, 80), 983240, 4, 0.55, 2.0, NOISE_FLAG_EASED);
np_crumble = NoiseParams(0, 1, v3f(20, 20, 20), 34413, 3, 1.3, 2.0, NOISE_FLAG_EASED); np_crumble = NoiseParams(0, 1, v3f(20, 20, 20), 34413, 3, 1.3, 2.0, NOISE_FLAG_EASED);
np_wetness = NoiseParams(0, 1, v3f(40, 40, 40), 32474, 4, 1.1, 2.0); np_wetness = NoiseParams(0, 1, v3f(40, 40, 40), 32474, 4, 1.1, 2.0);
} }
@ -439,10 +439,12 @@ void MapgenV5::generateBiomes() {
if (c_below != CONTENT_AIR) { if (c_below != CONTENT_AIR) {
if (nplaced < y0_top) { if (nplaced < y0_top) {
if(y < water_level) // A hack to prevent dirt_with_grass from being
vm->m_data[i] = MapNode(biome->c_filler); // placed below water. TODO: fix later
else content_t c_place = ((y < water_level) &&
vm->m_data[i] = MapNode(biome->c_top); (biome->c_top == c_dirt_with_grass)) ?
c_dirt : biome->c_top;
vm->m_data[i] = MapNode(c_place);
nplaced++; nplaced++;
} else if (nplaced < y0_filler && nplaced >= y0_top) { } else if (nplaced < y0_filler && nplaced >= y0_top) {
vm->m_data[i] = MapNode(biome->c_filler); vm->m_data[i] = MapNode(biome->c_filler);

@ -122,13 +122,13 @@ MapgenV7::~MapgenV7() {
MapgenV7Params::MapgenV7Params() { MapgenV7Params::MapgenV7Params() {
spflags = MGV7_MOUNTAINS | MGV7_RIDGES; spflags = MGV7_MOUNTAINS | MGV7_RIDGES;
np_terrain_base = NoiseParams(4, 70, v3f(300, 300, 300), 82341, 6, 0.7, 2.0); np_terrain_base = NoiseParams(4, 70, v3f(300, 300, 300), 82341, 6, 0.7, 2.0);
np_terrain_alt = NoiseParams(4, 25, v3f(600, 600, 600), 5934, 5, 0.6, 2.0); np_terrain_alt = NoiseParams(4, 25, v3f(600, 600, 600), 5934, 5, 0.6, 2.0);
np_terrain_persist = NoiseParams(0.6, 0.1, v3f(500, 500, 500), 539, 3, 0.6, 2.0); np_terrain_persist = NoiseParams(0.6, 0.1, v3f(500, 500, 500), 539, 3, 0.6, 2.0);
np_height_select = NoiseParams(-0.5, 1, v3f(250, 250, 250), 4213, 5, 0.69, 2.0); np_height_select = NoiseParams(-0.5, 1, v3f(250, 250, 250), 4213, 5, 0.69, 2.0);
np_filler_depth = NoiseParams(0, 1.2, v3f(150, 150, 150), 261, 4, 0.7, 2.0); np_filler_depth = NoiseParams(0, 1.2, v3f(150, 150, 150), 261, 4, 0.7, 2.0);
np_mount_height = NoiseParams(100, 30, v3f(500, 500, 500), 72449, 4, 0.6, 2.0); np_mount_height = NoiseParams(100, 30, v3f(500, 500, 500), 72449, 4, 0.6, 2.0);
np_ridge_uwater = NoiseParams(0, 1, v3f(500, 500, 500), 85039, 4, 0.6, 2.0); np_ridge_uwater = NoiseParams(0, 1, v3f(500, 500, 500), 85039, 4, 0.6, 2.0);
np_mountain = NoiseParams(0, 1, v3f(250, 350, 250), 5333, 5, 0.68, 2.0); np_mountain = NoiseParams(0, 1, v3f(250, 350, 250), 5333, 5, 0.68, 2.0);
np_ridge = NoiseParams(0, 1, v3f(100, 100, 100), 6467, 4, 0.75, 2.0); np_ridge = NoiseParams(0, 1, v3f(100, 100, 100), 6467, 4, 0.75, 2.0);
} }
@ -545,10 +545,12 @@ void MapgenV7::generateBiomes() {
if (c_below != CONTENT_AIR) { if (c_below != CONTENT_AIR) {
if (nplaced < y0_top) { if (nplaced < y0_top) {
if(y < water_level) // A hack to prevent dirt_with_grass from being
vm->m_data[i] = MapNode(biome->c_filler); // placed below water. TODO: fix later
else content_t c_place = ((y < water_level) &&
vm->m_data[i] = MapNode(biome->c_top); (biome->c_top == c_dirt_with_grass)) ?
c_dirt : biome->c_top;
vm->m_data[i] = MapNode(c_place);
nplaced++; nplaced++;
} else if (nplaced < y0_filler && nplaced >= y0_top) { } else if (nplaced < y0_filler && nplaced >= y0_top) {
vm->m_data[i] = MapNode(biome->c_filler); vm->m_data[i] = MapNode(biome->c_filler);