aboutsummaryrefslogtreecommitdiff
path: root/src/mapnode.h
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-11-05 23:30:27 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-11-05 23:30:27 +0200
commitc1d92d72e1af6d99c6fdbeec0900326dd9938fd2 (patch)
tree96ee34e137a18c46a487ebcd35a59f0d1d5ec4c8 /src/mapnode.h
parent4f71a9fbded5642fc606a7d28ca07dbc5a8efb17 (diff)
downloadminetest-c1d92d72e1af6d99c6fdbeec0900326dd9938fd2.tar.gz
minetest-c1d92d72e1af6d99c6fdbeec0900326dd9938fd2.tar.bz2
minetest-c1d92d72e1af6d99c6fdbeec0900326dd9938fd2.zip
Make water invisible next to underwater glass
Diffstat (limited to 'src/mapnode.h')
-rw-r--r--src/mapnode.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/mapnode.h b/src/mapnode.h
index fb7244322..81445b9ac 100644
--- a/src/mapnode.h
+++ b/src/mapnode.h
@@ -395,8 +395,22 @@ inline u8 face_contents(content_t m1, content_t m2)
if(makes_face == false)
return 0;
+
+ u8 c1 = content_solidness(m1);
+ u8 c2 = content_solidness(m2);
+
+ /*
+ Special case for half-transparent content.
+
+ This makes eg. the water (solidness=1) surrounding an underwater
+ glass block (solidness=0, visual_solidness=1) not get drawn.
+ */
+ if(c1 == 1 && c2 == 0 && content_features(m2).visual_solidness != 0)
+ return 0;
+ if(c2 == 1 && c1 == 0 && content_features(m1).visual_solidness != 0)
+ return 0;
- if(content_solidness(m1) > content_solidness(m2))
+ if(c1 > c2)
return 1;
else
return 2;