mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r26938) -Codechange: simplify RandomHeight significantly
This commit is contained in:
parent
2b0a1f7beb
commit
08aaabcbb4
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue