Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #2267 from paramat/v7posmounth
Mgv7: Add lower limit of zero to mountain height noise
  • Loading branch information
paramat committed Feb 18, 2015
2 parents 804d65a + 4546acf commit 4d5db3a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mapgen_v7.cpp
Expand Up @@ -361,15 +361,15 @@ float MapgenV7::baseTerrainLevelFromMap(int index)

bool MapgenV7::getMountainTerrainAtPoint(int x, int y, int z)
{
float mnt_h_n = NoisePerlin2D(&noise_mount_height->np, x, z, seed);
float mnt_h_n = MYMAX(NoisePerlin2D(&noise_mount_height->np, x, z, seed), 0);
float mnt_n = NoisePerlin3D(&noise_mountain->np, x, y, z, seed);
return mnt_n * mnt_h_n >= (float)y;
}


bool MapgenV7::getMountainTerrainFromMap(int idx_xyz, int idx_xz, int y)
{
float mounthn = noise_mount_height->result[idx_xz];
float mounthn = MYMAX(noise_mount_height->result[idx_xz], 0);
float mountn = noise_mountain->result[idx_xyz];
return mountn * mounthn >= (float)y;
}
Expand Down

0 comments on commit 4d5db3a

Please sign in to comment.