Skip to content

Commit 9dfac4b

Browse files
committed
Fix water placement
1 parent b061ae3 commit 9dfac4b

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed
-56.7 KB
Binary file not shown.

src/TerrainGen/Terrain_Gen.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ void TerrainGen::generate(GridMap *myGridMap, int height, int width, int depth,
4545

4646
for (int y = 0; y < height; y++) {
4747
for (int x = 0; x < width; x++) {
48-
float n = noise->get_noise_2d((float)x, (float)y);
49-
heightMap[y][x] = round(((n + 1.0f) / 2.0f) * (depth - 1));
48+
heightMap[y][x] = noise->get_noise_2d((float)x, (float)y) / 2.0f * 0.5f;
5049
}
5150
}
5251

@@ -75,7 +74,7 @@ void TerrainGen::generate(GridMap *myGridMap, int height, int width, int depth,
7574
}
7675
// Water assignment
7776
if (elevation == 1 && !isEdge) {
78-
myGridMap->set_cell_item(Vector3i(x, y, elevation), WATER, 0);
77+
myGridMap->set_cell_item(Vector3i(x, elevation, y), WATER, 0);
7978
continue;
8079
}
8180

0 commit comments

Comments
 (0)