From 08aaabcbb4bcb18a88839797d4b9f25652260a22 Mon Sep 17 00:00:00 2001 From: rubidium Date: Mon, 29 Sep 2014 19:04:02 +0000 Subject: (svn r26938) -Codechange: simplify RandomHeight significantly --- src/tgp.cpp | 5 +---- 1 file changed, 1 insertion(+), 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); } /** -- cgit v1.2.3-54-g00ecf