1
0

Fix terrain checking minimal bound

This commit is contained in:
Victor 2014-03-15 17:26:52 +02:00
parent aa5ea51e02
commit e2d10e0beb

View File

@ -75,7 +75,7 @@ public class Terrain implements Constants {
for (int i = 1; i < blocksCount; i++) { for (int i = 1; i < blocksCount; i++) {
int value = blockHeights[i - 1] + rnd.nextInt(2 * stepHeight + 1) - stepHeight; int value = blockHeights[i - 1] + rnd.nextInt(2 * stepHeight + 1) - stepHeight;
if (value > maxHeight) value = maxHeight; if (value > maxHeight) value = maxHeight;
else if (blockHeights[i] < 0) value = 0; else if (value < 0) value = 0;
blockHeights[i] = value; blockHeights[i] = value;
// Detect max block height // Detect max block height
if (maxBlockHeight < value) maxBlockHeight = value; if (maxBlockHeight < value) maxBlockHeight = value;