summaryrefslogtreecommitdiff
path: root/src/landscape.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2014-10-13 14:22:48 +0000
committerrubidium <rubidium@openttd.org>2014-10-13 14:22:48 +0000
commit8d90e86c2c6b0ae633714d015c0b9dcbba421185 (patch)
tree02ce0d0f48e24a044afbc472bf820bc6f7d0ce36 /src/landscape.cpp
parentfcdbdd60439578a8bae7b3e211e7e088ebcb6785 (diff)
downloadopenttd-8d90e86c2c6b0ae633714d015c0b9dcbba421185.tar.xz
(svn r27009) -Add: extra level of general map heightness (ChillCore)
Diffstat (limited to 'src/landscape.cpp')
-rw-r--r--src/landscape.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/landscape.cpp b/src/landscape.cpp
index 0f21b2920..d1c73fd42 100644
--- a/src/landscape.cpp
+++ b/src/landscape.cpp
@@ -1273,7 +1273,8 @@ void GenerateLandscape(byte mode)
assert(_settings_game.difficulty.quantity_sea_lakes != CUSTOM_SEA_LEVEL_NUMBER_DIFFICULTY);
uint i = ScaleByMapSize(GB(r, 0, 7) + (3 - _settings_game.difficulty.quantity_sea_lakes) * 256 + 100);
for (; i != 0; --i) {
- GenerateTerrain(_settings_game.difficulty.terrain_type, 0);
+ /* Make sure we do not overflow. */
+ GenerateTerrain(Clamp(_settings_game.difficulty.terrain_type, 0, 3), 0);
}
break;
}