//TimeTaker timer("initBlockMake() initialEmerge");
data->vmanip->initialEmerge(bigarea_blocks_min, bigarea_blocks_max, false);
}
-
+
// Ensure none of the blocks to be generated were marked as containing CONTENT_IGNORE
/* for (s16 z = blockpos_min.Z; z <= blockpos_max.Z; z++) {
for (s16 y = blockpos_min.Y; y <= blockpos_max.Y; y++) {
return true;
}
-MapBlock* ServerMap::finishBlockMake(BlockMakeData *data,
+void ServerMap::finishBlockMake(BlockMakeData *data,
std::map<v3s16, MapBlock*> &changed_blocks)
{
v3s16 blockpos_min = data->blockpos_min;
y<=blockpos_max.Y+extra_borders.Y; y++)
{
v3s16 p(x, y, z);
- getBlockNoCreateNoEx(p)->setLightingExpired(false);
+ MapBlock * block = getBlockNoCreateNoEx(p);
+ if (block != NULL)
+ block->setLightingExpired(false);
}
#if 0
i != changed_blocks.end(); ++i)
{
MapBlock *block = i->second;
- assert(block);
+ if (!block)
+ continue;
/*
Update day/night difference cache of the MapBlocks
*/
{
v3s16 p(x, y, z);
MapBlock *block = getBlockNoCreateNoEx(p);
- assert(block);
+ if (!block)
+ continue;
block->setGenerated(true);
}
/*infostream<<"finishBlockMake() done for ("<<blockpos_requested.X
<<","<<blockpos_requested.Y<<","
<<blockpos_requested.Z<<")"<<std::endl;*/
-
-
+
+
#if 0
if(enable_mapgen_debug_info)
{
}
#endif
- MapBlock *block = getBlockNoCreateNoEx(blockpos_requested);
- assert(block);
-
- return block;
+ getBlockNoCreateNoEx(blockpos_requested);
}
ServerMapSector * ServerMap::createSector(v2s16 p2d)
break;
params.parseConfigLine(line);
}
-
+
m_emerge->loadParamsFromSettings(¶ms);
verbosestream<<"ServerMap::loadMapMeta(): seed="
if(block_data_inexistent)
{
-
+
if (load_if_inexistent) {
ServerMap *svrmap = (ServerMap *)m_map;
block = svrmap->emergeBlock(p, false);
block->copyTo(*this);
} else {
flags |= VMANIP_BLOCK_DATA_INEXIST;
-
+
/*
Mark area inexistent
*/
v3s16 p = i->first;
MapBlock *block = m_map->getBlockNoCreateNoEx(p);
bool existed = !(i->second & VMANIP_BLOCK_DATA_INEXIST);
- if(existed == false)
+ if((existed == false) || (block == NULL))
{
continue;
}
Blocks are generated by using these and makeBlock().
*/
bool initBlockMake(BlockMakeData *data, v3s16 blockpos);
- MapBlock *finishBlockMake(BlockMakeData *data,
+ void finishBlockMake(BlockMakeData *data,
std::map<v3s16, MapBlock*> &changed_blocks);
/*
*/
MapBlock * emergeBlock(v3s16 p, bool create_blank=true);
-
+
/*
Try to get a block.
If it does not exist in memory, add it to the emerge queue.