summaryrefslogtreecommitdiffstats
path: root/src/Generating
diff options
context:
space:
mode:
authorJulian Laubstein <julianlaubstein@yahoo.de>2015-07-14 00:14:12 +0200
committerJulian Laubstein <julianlaubstein@yahoo.de>2015-07-14 00:14:12 +0200
commit118aec119853dfcae1dca90ad54c3720f9271bbc (patch)
tree8f3cae01a07979fc99e766944e0203f10200aca1 /src/Generating
parentMerge pull request #2344 from bibo38/make_ptr (diff)
parentSwitched from using std::max(std::min()) to using Clamp (diff)
downloadcuberite-118aec119853dfcae1dca90ad54c3720f9271bbc.tar
cuberite-118aec119853dfcae1dca90ad54c3720f9271bbc.tar.gz
cuberite-118aec119853dfcae1dca90ad54c3720f9271bbc.tar.bz2
cuberite-118aec119853dfcae1dca90ad54c3720f9271bbc.tar.lz
cuberite-118aec119853dfcae1dca90ad54c3720f9271bbc.tar.xz
cuberite-118aec119853dfcae1dca90ad54c3720f9271bbc.tar.zst
cuberite-118aec119853dfcae1dca90ad54c3720f9271bbc.zip
Diffstat (limited to '')
-rw-r--r--src/Generating/BioGen.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Generating/BioGen.cpp b/src/Generating/BioGen.cpp
index f0d2af4f3..ff8827511 100644
--- a/src/Generating/BioGen.cpp
+++ b/src/Generating/BioGen.cpp
@@ -641,8 +641,8 @@ void cBioGenMultiStepMap::BuildTemperatureHumidityMaps(int a_ChunkX, int a_Chunk
// Re-map into integral values in [0 .. 255] range:
for (size_t idx = 0; idx < ARRAYCOUNT(a_TemperatureMap); idx++)
{
- a_TemperatureMap[idx] = std::max(0, std::min(255, static_cast<int>(128 + TemperatureMap[idx] * 128)));
- a_HumidityMap[idx] = std::max(0, std::min(255, static_cast<int>(128 + HumidityMap[idx] * 128)));
+ a_TemperatureMap[idx] = Clamp(static_cast<int>(128 + TemperatureMap[idx] * 128), 0, 255);
+ a_HumidityMap[idx] = Clamp(static_cast<int>(128 + HumidityMap[idx] * 128), 0, 255);
}
}