diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-01-15 01:26:29 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-01-15 01:26:29 +0200 |
commit | cfaa15895ad73ce3cef174f770d877059e9708e0 (patch) | |
tree | e60ae78be33a6647771b2ca2470db78ffdf7a5eb /src/mapblock.cpp | |
parent | 023876dafb450b0339df7819efdd67557b564173 (diff) | |
download | minetest-cfaa15895ad73ce3cef174f770d877059e9708e0.tar.gz minetest-cfaa15895ad73ce3cef174f770d877059e9708e0.tar.bz2 minetest-cfaa15895ad73ce3cef174f770d877059e9708e0.zip |
tweaking around, including mapgen, player speed in water, settings
Diffstat (limited to 'src/mapblock.cpp')
-rw-r--r-- | src/mapblock.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/mapblock.cpp b/src/mapblock.cpp index 90ff05bd1..2d077121c 100644 --- a/src/mapblock.cpp +++ b/src/mapblock.cpp @@ -876,6 +876,7 @@ bool MapBlock::propagateSunlight(core::map<v3s16, bool> & light_sources) { for(s16 z=0; z<MAP_BLOCKSIZE; z++) { +#if 1 bool no_sunlight = false; bool no_top_block = false; // Check if node above block has sunlight @@ -901,6 +902,23 @@ bool MapBlock::propagateSunlight(core::map<v3s16, bool> & light_sources) // No sunlight here //no_sunlight = true; } +#endif +#if 0 // Doesn't work; nothing gets light. + bool no_sunlight = true; + bool no_top_block = false; + // Check if node above block has sunlight + try{ + MapNode n = getNodeParent(v3s16(x, MAP_BLOCKSIZE, z)); + if(n.getLight(LIGHTBANK_DAY) == LIGHT_SUN) + { + no_sunlight = false; + } + } + catch(InvalidPositionException &e) + { + no_top_block = true; + } +#endif /*std::cout<<"("<<x<<","<<z<<"): " <<"no_top_block="<<no_top_block |