X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fmapblock.cpp;h=ca80c39d71cae6d55d9f2a49cccbdccdc2ebeb18;hb=aa340fd857c151384873f2b29a9bad76e49e852a;hp=255b661b0beac3dead9edd4b82dc4d36e952cca7;hpb=5b8855e83c0d1cc7aef21492e7fe862b7d06917e;p=minetest.git diff --git a/src/mapblock.cpp b/src/mapblock.cpp index 255b661b0..ca80c39d7 100644 --- a/src/mapblock.cpp +++ b/src/mapblock.cpp @@ -62,7 +62,7 @@ MapBlock::MapBlock(Map *parent, v3s16 pos, IGameDef *gamedef, bool dummy): data = NULL; if(dummy == false) reallocate(); - + #ifndef SERVER mesh = NULL; #endif @@ -73,7 +73,7 @@ MapBlock::~MapBlock() #ifndef SERVER { //JMutexAutoLock lock(mesh_mutex); - + if(mesh) { delete mesh; @@ -115,7 +115,7 @@ MapNode MapBlock::getNodeParent(v3s16 p, bool *is_valid_position) /* Propagates sunlight down through the block. Doesn't modify nodes that are not affected by sunlight. - + Returns false if sunlight at bottom block is invalid. Returns true if sunlight at bottom block is valid. Returns true if bottom block doesn't exist. @@ -138,16 +138,16 @@ bool MapBlock::propagateSunlight(std::set & light_sources, // Whether the sunlight at the top of the bottom block is valid bool block_below_is_valid = true; - + v3s16 pos_relative = getPosRelative(); - + for(s16 x=0; x & light_sources, } else { - no_top_block = true; - + //no_top_block = true; + // NOTE: This makes over-ground roofed places sunlighted // Assume sunlight, unless is_underground==true if(is_underground) @@ -211,19 +211,19 @@ bool MapBlock::propagateSunlight(std::set & light_sources, <<", is_underground="<= 25){ // Node timers m_node_timers.serialize(os, version); @@ -626,7 +617,7 @@ void MapBlock::deSerialize(std::istream &is, u8 version, bool disk) { if(!ser_ver_supported(version)) throw VersionMismatchException("ERROR: MapBlock format not supported"); - + TRACESTREAM(<<"MapBlock::deSerialize "<= 10) { // Uncompress and set param2 data @@ -852,7 +843,7 @@ void MapBlock::deSerialize_pre22(std::istream &is, u8 version, bool disk) databuf_nodelist[i*ser_length + 1] = s[i+nodecount]; databuf_nodelist[i*ser_length + 2] = s[i+nodecount*2]; } - + /* NodeMetadata */ @@ -989,12 +980,12 @@ std::string analyze_block(MapBlock *block) return "NULL"; std::ostringstream desc; - + v3s16 p = block->getPos(); char spos[20]; snprintf(spos, 20, "(%2d,%2d,%2d), ", p.X, p.Y, p.Z); desc<getModified()) { case MOD_STATE_CLEAN: @@ -1051,21 +1042,21 @@ std::string analyze_block(MapBlock *block) else full_air = false; } - + desc<<"content {"; - + std::ostringstream ss; - + if(full_ignore) ss<<"IGNORE (full), "; else if(some_ignore) ss<<"IGNORE, "; - + if(full_air) ss<<"AIR (full), "; else if(some_air) ss<<"AIR, "; - + if(ss.str().size()>=2) desc<