diff options
author | rubidium <rubidium@openttd.org> | 2014-09-29 19:04:02 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2014-09-29 19:04:02 +0000 |
commit | 08aaabcbb4bcb18a88839797d4b9f25652260a22 (patch) | |
tree | 69e1cf7fc9e977965f0d07198000ed878b4b7117 /src | |
parent | 2b0a1f7beba2eeb2c5f8d992dcfed2273fda8096 (diff) | |
download | openttd-08aaabcbb4bcb18a88839797d4b9f25652260a22.tar.xz |
(svn r26938) -Codechange: simplify RandomHeight significantly
Diffstat (limited to 'src')
-rw-r--r-- | src/tgp.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/tgp.cpp b/src/tgp.cpp index 225f3bb71..7889fc17e 100644 --- a/src/tgp.cpp +++ b/src/tgp.cpp @@ -281,11 +281,8 @@ static inline void FreeHeightMap() */ static inline height_t RandomHeight(amplitude_t rMax) { - amplitude_t ra = (Random() << 16) | (Random() & 0x0000FFFF); - height_t rh; /* Spread height into range -rMax..+rMax */ - rh = A2H(ra % (2 * rMax + 1) - rMax); - return rh; + return A2H(RandomRange(2 * rMax + 1) - rMax); } /** |