]> git.lizzy.rs Git - dragonfireclient.git/commitdiff
fix integer overflow (fixes #414)
authorJürgen Doser <jurgen.doser@gmail.com>
Sat, 12 Jan 2013 19:20:21 +0000 (20:20 +0100)
committerIlya Zhuravlev <zhuravlevilya@ya.ru>
Sat, 12 Jan 2013 19:32:09 +0000 (23:32 +0400)
liquid_kind was declared as an u8, but used to hold a content_t value, which is delcared to be a u16.

changing this fixes (at least for me) the problem reported in bug #414.

src/map.cpp

index 2845f3a67de7ed93228982da25769242ee9f5f2e..0e9b121d76f9a3fc04b9f3ac6cc93183edcd706f 100644 (file)
@@ -1651,7 +1651,7 @@ void Map::transformLiquids(core::map<v3s16, MapBlock*> & modified_blocks)
                        Collect information about current node
                 */
                s8 liquid_level = -1;
-               u8 liquid_kind = CONTENT_IGNORE;
+               content_t liquid_kind = CONTENT_IGNORE;
                LiquidType liquid_type = nodemgr->get(n0).liquid_type;
                switch (liquid_type) {
                        case LIQUID_SOURCE: