diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2011-08-16 16:46:55 +0200 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2011-08-16 16:50:38 +0200 |
commit | 7024b4519746f267144482a47136a32f9a697546 (patch) | |
tree | 6cb4b91e9a8a22b4c06990dc163be086046bd3dd /src | |
parent | 5fce673a569747960dbe5befec8e2c42b87ce7f6 (diff) | |
download | minetest-7024b4519746f267144482a47136a32f9a697546.tar.gz minetest-7024b4519746f267144482a47136a32f9a697546.tar.bz2 minetest-7024b4519746f267144482a47136a32f9a697546.zip |
Ensure param2 is set correctly in transformLiquids
Diffstat (limited to 'src')
-rw-r--r-- | src/map.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/map.cpp b/src/map.cpp index 94cf2e864..6092538fe 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -1731,14 +1731,14 @@ void Map::transformLiquids(core::map<v3s16, MapBlock*> & modified_blocks) update the current node */ bool flow_down_enabled = (flowing_down && ((n0.param2 & LIQUID_FLOW_DOWN_MASK) != LIQUID_FLOW_DOWN_MASK)); - n0.setContent(new_node_content); - if (content_features(n0.getContent()).liquid_type == LIQUID_FLOWING) { + if (content_features(new_node_content).liquid_type == LIQUID_FLOWING) { // set level to last 3 bits, flowing down bit to 4th bit - n0.param2 |= (flowing_down ? LIQUID_FLOW_DOWN_MASK : 0x00) | (new_node_level & LIQUID_LEVEL_MASK); + n0.param2 = (flowing_down ? LIQUID_FLOW_DOWN_MASK : 0x00) | (new_node_level & LIQUID_LEVEL_MASK); } else { // set the liquid level and flow bit to 0 - n0.param2 &= ~(LIQUID_LEVEL_MASK | LIQUID_FLOW_DOWN_MASK); + n0.param2 = ~(LIQUID_LEVEL_MASK | LIQUID_FLOW_DOWN_MASK); } + n0.setContent(new_node_content); setNode(p0, n0); v3s16 blockpos = getNodeBlockPos(p0); MapBlock *block = getBlockNoCreateNoEx(blockpos); |