diff options
author | Nils Dagsson Moskopp <nils@dieweltistgarnichtso.net> | 2011-07-22 20:16:58 +0200 |
---|---|---|
committer | Nils Dagsson Moskopp <nils@dieweltistgarnichtso.net> | 2011-07-22 20:16:58 +0200 |
commit | 7985d746f97ce1b37b6ca48a8a3e7ed70d02e4b0 (patch) | |
tree | 503647a4d173e9bd29dd489310dedb0db37088ff /src/map.cpp | |
parent | a45f287ae1b96742dfd03a01e0b558385e7b1384 (diff) | |
parent | f706644a50b9bc62de39f571b044c7f7c55078e4 (diff) | |
download | minetest-7985d746f97ce1b37b6ca48a8a3e7ed70d02e4b0.tar.gz minetest-7985d746f97ce1b37b6ca48a8a3e7ed70d02e4b0.tar.bz2 minetest-7985d746f97ce1b37b6ca48a8a3e7ed70d02e4b0.zip |
Merge branch 'upstream/master'
Diffstat (limited to 'src/map.cpp')
-rw-r--r-- | src/map.cpp | 68 |
1 files changed, 41 insertions, 27 deletions
diff --git a/src/map.cpp b/src/map.cpp index e47b1b212..e1769b8ef 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -2005,7 +2005,15 @@ void ServerMap::initBlockMake(mapgen::BlockMakeData *data, v3s16 blockpos) { /*dstream<<"initBlockMake(): ("<<blockpos.X<<","<<blockpos.Y<<"," <<blockpos.Z<<")"<<std::endl;*/ - + + // Do nothing if not inside limits (+-1 because of neighbors) + if(blockpos_over_limit(blockpos - v3s16(1,1,1)) || + blockpos_over_limit(blockpos + v3s16(1,1,1))) + { + data->no_op = true; + return; + } + data->no_op = false; data->seed = m_seed; data->blockpos = blockpos; @@ -2056,6 +2064,7 @@ void ServerMap::initBlockMake(mapgen::BlockMakeData *data, v3s16 blockpos) neighboring blocks */ + // The area that contains this block and it's neighbors v3s16 bigarea_blocks_min = blockpos - v3s16(1,1,1); v3s16 bigarea_blocks_max = blockpos + v3s16(1,1,1); @@ -2080,7 +2089,7 @@ MapBlock* ServerMap::finishBlockMake(mapgen::BlockMakeData *data, if(data->no_op) { - dstream<<"finishBlockMake(): no-op"<<std::endl; + //dstream<<"finishBlockMake(): no-op"<<std::endl; return NULL; } @@ -2332,49 +2341,54 @@ MapBlock * ServerMap::generateBlock( Get central block */ MapBlock *block = getBlockNoCreateNoEx(p); - assert(block); #if 0 /* Check result */ - bool erroneus_content = false; - for(s16 z0=0; z0<MAP_BLOCKSIZE; z0++) - for(s16 y0=0; y0<MAP_BLOCKSIZE; y0++) - for(s16 x0=0; x0<MAP_BLOCKSIZE; x0++) + if(block) { - v3s16 p(x0,y0,z0); - MapNode n = block->getNode(p); - if(n.d == CONTENT_IGNORE) + bool erroneus_content = false; + for(s16 z0=0; z0<MAP_BLOCKSIZE; z0++) + for(s16 y0=0; y0<MAP_BLOCKSIZE; y0++) + for(s16 x0=0; x0<MAP_BLOCKSIZE; x0++) + { + v3s16 p(x0,y0,z0); + MapNode n = block->getNode(p); + if(n.d == CONTENT_IGNORE) + { + dstream<<"CONTENT_IGNORE at " + <<"("<<p.X<<","<<p.Y<<","<<p.Z<<")" + <<std::endl; + erroneus_content = true; + assert(0); + } + } + if(erroneus_content) { - dstream<<"CONTENT_IGNORE at " - <<"("<<p.X<<","<<p.Y<<","<<p.Z<<")" - <<std::endl; - erroneus_content = true; assert(0); } } - if(erroneus_content) - { - assert(0); - } #endif #if 0 /* Generate a completely empty block */ - for(s16 z0=0; z0<MAP_BLOCKSIZE; z0++) - for(s16 x0=0; x0<MAP_BLOCKSIZE; x0++) + if(block) { - for(s16 y0=0; y0<MAP_BLOCKSIZE; y0++) + for(s16 z0=0; z0<MAP_BLOCKSIZE; z0++) + for(s16 x0=0; x0<MAP_BLOCKSIZE; x0++) { - MapNode n; - if(y0%2==0) - n.d = CONTENT_AIR; - else - n.d = CONTENT_STONE; - block->setNode(v3s16(x0,y0,z0), n); + for(s16 y0=0; y0<MAP_BLOCKSIZE; y0++) + { + MapNode n; + if(y0%2==0) + n.d = CONTENT_AIR; + else + n.d = CONTENT_STONE; + block->setNode(v3s16(x0,y0,z0), n); + } } } #endif |