Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4546acf

Browse files
committedFeb 18, 2015
Mgv7: Limit mountain height to positive only, for better control of mountain areas
1 parent 804d65a commit 4546acf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

Diff for: ‎src/mapgen_v7.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -361,15 +361,15 @@ float MapgenV7::baseTerrainLevelFromMap(int index)
361361

362362
bool MapgenV7::getMountainTerrainAtPoint(int x, int y, int z)
363363
{
364-
float mnt_h_n = NoisePerlin2D(&noise_mount_height->np, x, z, seed);
364+
float mnt_h_n = MYMAX(NoisePerlin2D(&noise_mount_height->np, x, z, seed), 0);
365365
float mnt_n = NoisePerlin3D(&noise_mountain->np, x, y, z, seed);
366366
return mnt_n * mnt_h_n >= (float)y;
367367
}
368368

369369

370370
bool MapgenV7::getMountainTerrainFromMap(int idx_xyz, int idx_xz, int y)
371371
{
372-
float mounthn = noise_mount_height->result[idx_xz];
372+
float mounthn = MYMAX(noise_mount_height->result[idx_xz], 0);
373373
float mountn = noise_mountain->result[idx_xyz];
374374
return mountn * mounthn >= (float)y;
375375
}

0 commit comments

Comments
 (0)
Please sign in to comment.