aboutsummaryrefslogtreecommitdiff
path: root/src/content_mapblock.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/content_mapblock.cpp')
-rw-r--r--src/content_mapblock.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/content_mapblock.cpp b/src/content_mapblock.cpp
index bc17e19aa..d2509ad5a 100644
--- a/src/content_mapblock.cpp
+++ b/src/content_mapblock.cpp
@@ -395,6 +395,8 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
l = getInteriorLight(n, 0, data);
video::SColor c = MapBlock_LightColor(f.alpha, l, decode_light(f.light_source));
+ u8 range = rangelim(nodedef->get(c_flowing).liquid_range, 0, 8);
+
// Neighbor liquid levels (key = relative position)
// Includes current node
std::map<v3s16, f32> neighbor_levels;
@@ -426,9 +428,10 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
if(n2.getContent() == c_source)
level = (-0.5+node_liquid_level) * BS;
- else if(n2.getContent() == c_flowing)
- level = (-0.5 + ((float)(n2.param2&LIQUID_LEVEL_MASK)
- + 0.5) / (float)LIQUID_LEVEL_SOURCE * node_liquid_level) * BS;
+ else if(n2.getContent() == c_flowing){
+ u8 liquid_level = (n2.param2&LIQUID_LEVEL_MASK) - (LIQUID_LEVEL_MAX+1-range);
+ level = (-0.5 + ((float)liquid_level+ 0.5) / (float)range * node_liquid_level) * BS;
+ }
// Check node above neighbor.
// NOTE: This doesn't get executed if neighbor