summaryrefslogtreecommitdiff
path: root/src/map.cpp
diff options
context:
space:
mode:
authorCraig Robbins <kde.psych@gmail.com>2014-12-29 23:53:08 +1000
committerCraig Robbins <kde.psych@gmail.com>2014-12-29 23:56:40 +1000
commit3993102e880f2a31b6fef9484b8527a58e850744 (patch)
tree780f07bbcddbf5ec0e2b820d675aff615cab0476 /src/map.cpp
parent5038b9aaeced00396e37f4d6665f8afe21169a8a (diff)
downloadminetest-3993102e880f2a31b6fef9484b8527a58e850744.tar.gz
minetest-3993102e880f2a31b6fef9484b8527a58e850744.tar.bz2
minetest-3993102e880f2a31b6fef9484b8527a58e850744.zip
Fix -Wtype-limits warnings and remove disabling of -Wtype-limits
Diffstat (limited to 'src/map.cpp')
-rw-r--r--src/map.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/map.cpp b/src/map.cpp
index 7a58c90c7..1c1cd7c28 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -1766,7 +1766,11 @@ void Map::transformLiquids(std::map<v3s16, MapBlock*> & modified_blocks)
content_t new_node_content;
s8 new_node_level = -1;
s8 max_node_level = -1;
- u8 range = rangelim(nodemgr->get(liquid_kind).liquid_range, 0, LIQUID_LEVEL_MAX+1);
+
+ u8 range = nodemgr->get(liquid_kind).liquid_range;
+ if (range > LIQUID_LEVEL_MAX+1)
+ range = LIQUID_LEVEL_MAX+1;
+
if ((num_sources >= 2 && nodemgr->get(liquid_kind).liquid_renewable) || liquid_type == LIQUID_SOURCE) {
// liquid_kind will be set to either the flowing alternative of the node (if it's a liquid)
// or the flowing alternative of the first of the surrounding sources (if it's air), so