diff options
author | Duane Robertson <duane@duanerobertson.com> | 2016-01-18 01:55:08 -0600 |
---|---|---|
committer | paramat <mat.gregory@virginmedia.com> | 2016-01-18 17:21:13 +0000 |
commit | eb6e2c11b16c9ef5287bda224fa965a37ef49131 (patch) | |
tree | 244970d96e894117bc0bd9188173ad3a0874d83f /src | |
parent | 13e7589fecfc8b6c247839ddaac66e9d045e513c (diff) | |
download | minetest-eb6e2c11b16c9ef5287bda224fa965a37ef49131.tar.gz minetest-eb6e2c11b16c9ef5287bda224fa965a37ef49131.tar.bz2 minetest-eb6e2c11b16c9ef5287bda224fa965a37ef49131.zip |
Correct overflowing rivers in Valleys mapgen.
Diffstat (limited to 'src')
-rw-r--r-- | src/mapgen_valleys.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mapgen_valleys.cpp b/src/mapgen_valleys.cpp index 93f47cd5f..6f4b2ccc7 100644 --- a/src/mapgen_valleys.cpp +++ b/src/mapgen_valleys.cpp @@ -670,8 +670,8 @@ int MapgenValleys::generateTerrain() for (s16 z = node_min.Z; z <= node_max.Z; z++) for (s16 x = node_min.X; x <= node_max.X; x++, index_2d++) { - s16 river_y = round(noise_rivers->result[index_2d]); - s16 surface_y = round(noise_terrain_height->result[index_2d]); + s16 river_y = floor(noise_rivers->result[index_2d]); + s16 surface_y = floor(noise_terrain_height->result[index_2d]); float slope = noise_inter_valley_slope->result[index_2d]; heightmap[index_2d] = surface_y; @@ -703,7 +703,7 @@ int MapgenValleys::generateTerrain() } else if (river && y < river_y) { // river vm->m_data[index_data] = n_river_water; - } else if ((!fast_terrain) && (!river) && fill * slope > y - surface_y) { + } else if ((!fast_terrain) && (!river) && round(fill * slope) >= y - surface_y) { // ground (slow method) vm->m_data[index_data] = n_stone; heightmap[index_2d] = surface_max_y = y; |