summaryrefslogtreecommitdiff
path: root/src/tgp.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2014-09-29 19:04:02 +0000
committerrubidium <rubidium@openttd.org>2014-09-29 19:04:02 +0000
commit08aaabcbb4bcb18a88839797d4b9f25652260a22 (patch)
tree69e1cf7fc9e977965f0d07198000ed878b4b7117 /src/tgp.cpp
parent2b0a1f7beba2eeb2c5f8d992dcfed2273fda8096 (diff)
downloadopenttd-08aaabcbb4bcb18a88839797d4b9f25652260a22.tar.xz
(svn r26938) -Codechange: simplify RandomHeight significantly
Diffstat (limited to 'src/tgp.cpp')
-rw-r--r--src/tgp.cpp5
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);
}
/**