diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-01-17 11:16:41 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-01-17 11:16:41 +0200 |
commit | bd26be262d30eeb0ca818b634891704de4365893 (patch) | |
tree | b49a6a009e6186e20b8ea916ecc20bda52242e32 /src/mapblock.cpp | |
parent | 3891bc43e084b9bd1c345638dfbbffa9d71658c9 (diff) | |
download | minetest-bd26be262d30eeb0ca818b634891704de4365893.tar.gz minetest-bd26be262d30eeb0ca818b634891704de4365893.tar.bz2 minetest-bd26be262d30eeb0ca818b634891704de4365893.zip |
commit before messing with water
Diffstat (limited to 'src/mapblock.cpp')
-rw-r--r-- | src/mapblock.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
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<v3s16, bool> & 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; |