summaryrefslogtreecommitdiffstats
path: root/src/Generating/BioGen.cpp
diff options
context:
space:
mode:
authorSamuel Barney <samjbarney@gmail.com>2015-07-13 22:17:43 +0200
committerSamuel Barney <samjbarney@gmail.com>2015-07-13 22:17:43 +0200
commit051787dbc255dc5b43477a0c5a68d03d9c341d3c (patch)
tree8f3cae01a07979fc99e766944e0203f10200aca1 /src/Generating/BioGen.cpp
parentMerge pull request #2344 from bibo38/make_ptr (diff)
downloadcuberite-051787dbc255dc5b43477a0c5a68d03d9c341d3c.tar
cuberite-051787dbc255dc5b43477a0c5a68d03d9c341d3c.tar.gz
cuberite-051787dbc255dc5b43477a0c5a68d03d9c341d3c.tar.bz2
cuberite-051787dbc255dc5b43477a0c5a68d03d9c341d3c.tar.lz
cuberite-051787dbc255dc5b43477a0c5a68d03d9c341d3c.tar.xz
cuberite-051787dbc255dc5b43477a0c5a68d03d9c341d3c.tar.zst
cuberite-051787dbc255dc5b43477a0c5a68d03d9c341d3c.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);
}
}