From bda468124249acac7f5de884c31946ce66bf0fda Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Sat, 23 Apr 2011 16:01:32 +0300 Subject: [PATCH] fixed flowing water lighting when it is below a solid block --- src/mapblock.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/mapblock.cpp b/src/mapblock.cpp index 6f7e7533..6cf816db 100644 --- a/src/mapblock.cpp +++ b/src/mapblock.cpp @@ -851,11 +851,17 @@ scene::SMesh* makeMapBlockMesh(MeshMakeData *data) else if(n.d == CONTENT_WATER) { bool top_is_water = false; - MapNode n = data->m_vmanip.getNodeNoEx(blockpos_nodes + v3s16(x,y+1,z)); - if(n.d == CONTENT_WATER || n.d == CONTENT_WATERSOURCE) + MapNode ntop = data->m_vmanip.getNodeNoEx(blockpos_nodes + v3s16(x,y+1,z)); + if(ntop.d == CONTENT_WATER || ntop.d == CONTENT_WATERSOURCE) top_is_water = true; - u8 l = decode_light(n.getLightBlend(data->m_daynight_ratio)); + u8 l = 0; + // Use the light of the node on top if possible + if(content_features(ntop.d).param_type == CPT_LIGHT) + l = decode_light(ntop.getLightBlend(data->m_daynight_ratio)); + // Otherwise use the light of this node (the water) + else + l = decode_light(n.getLightBlend(data->m_daynight_ratio)); video::SColor c(WATER_ALPHA,l,l,l); // Neighbor water levels (key = relative position) -- 2.30.2