diff options
author | Felix Krause <flyx@isobeef.org> | 2011-07-16 16:01:37 +0200 |
---|---|---|
committer | Nils Dagsson Moskopp <nils@dieweltistgarnichtso.net> | 2011-07-18 02:37:19 +0200 |
commit | def870953a9d964749cbd8fcfc050f69a0c8e53f (patch) | |
tree | df1d948f54f11721ec909102fb1a7e7b5b23da06 /src/content_mapblock.cpp | |
parent | f2c633050547964786c027590c423efd7ed34a95 (diff) | |
download | minetest-def870953a9d964749cbd8fcfc050f69a0c8e53f.tar.gz minetest-def870953a9d964749cbd8fcfc050f69a0c8e53f.tar.bz2 minetest-def870953a9d964749cbd8fcfc050f69a0c8e53f.zip |
* refactored liquid transformation code (has some flaws)
Completely rewrote the liquid transformation. The algorithm now exclusively modifies the current node in one iteration. Another change is that MapNode.param2 now stores a bit that tells other nodes if a flowing liquid node flows downwards. This is accomplished by two masks on param2 for the "flow down" bit and the "liquid level" bits.
This will be the base of future improvements to the liquid flow. However, in the current state flowing liquid does not always disappear when cut off its source. Be aware that this branch is work in progress.
Diffstat (limited to 'src/content_mapblock.cpp')
-rw-r--r-- | src/content_mapblock.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/content_mapblock.cpp b/src/content_mapblock.cpp index 4c28fe3c6..d8bf71dc0 100644 --- a/src/content_mapblock.cpp +++ b/src/content_mapblock.cpp @@ -375,7 +375,7 @@ void mapblock_mesh_generate_special(MeshMakeData *data, if(n2.d == CONTENT_WATERSOURCE) level = (-0.5+node_water_level) * BS; else if(n2.d == CONTENT_WATER) - level = (-0.5 + ((float)n2.param2 + 0.5) / 8.0 + level = (-0.5 + ((float)(n2.param2 & LIQUID_LEVEL_MASK) + 0.5) / 8.0 * node_water_level) * BS; // Check node above neighbor. |