From bd26be262d30eeb0ca818b634891704de4365893 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Mon, 17 Jan 2011 11:16:41 +0200 Subject: commit before messing with water --- src/mapblock.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/mapblock.cpp') diff --git a/src/mapblock.cpp b/src/mapblock.cpp index 252f123ac..9f91f0583 100644 --- a/src/mapblock.cpp +++ b/src/mapblock.cpp @@ -858,7 +858,7 @@ void MapBlock::updateMesh(u32 daynight_ratio) If there is a block above, continues from it. If there is no block above, assumes there is sunlight, unless - is_underground is set. + is_underground is set or highest node is water. At the moment, all sunlighted nodes are added to light_sources. - SUGG: This could be optimized @@ -903,7 +903,14 @@ bool MapBlock::propagateSunlight(core::map & light_sources, { no_sunlight = true; } - + else + { + MapNode n = getNode(v3s16(x, MAP_BLOCKSIZE-1, z)); + if(n.d == CONTENT_WATER || n.d == CONTENT_OCEAN) + { + no_sunlight = true; + } + } // NOTE: As of now, it just would make everything dark. // No sunlight here //no_sunlight = true; -- cgit v1.2.3