forked from Mirrorlandia_minetest/minetest
Minor stability improvements in block emerge handling
This commit is contained in:
parent
6c98fd6658
commit
9d57413af0
19
src/map.cpp
19
src/map.cpp
@ -2275,7 +2275,7 @@ bool ServerMap::initBlockMake(BlockMakeData *data, v3s16 blockpos)
|
||||
return true;
|
||||
}
|
||||
|
||||
MapBlock* ServerMap::finishBlockMake(BlockMakeData *data,
|
||||
void ServerMap::finishBlockMake(BlockMakeData *data,
|
||||
std::map<v3s16, MapBlock*> &changed_blocks)
|
||||
{
|
||||
v3s16 blockpos_min = data->blockpos_min;
|
||||
@ -2369,7 +2369,9 @@ MapBlock* ServerMap::finishBlockMake(BlockMakeData *data,
|
||||
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
|
||||
@ -2385,7 +2387,8 @@ MapBlock* ServerMap::finishBlockMake(BlockMakeData *data,
|
||||
i != changed_blocks.end(); ++i)
|
||||
{
|
||||
MapBlock *block = i->second;
|
||||
assert(block);
|
||||
if (!block)
|
||||
continue;
|
||||
/*
|
||||
Update day/night difference cache of the MapBlocks
|
||||
*/
|
||||
@ -2406,7 +2409,8 @@ MapBlock* ServerMap::finishBlockMake(BlockMakeData *data,
|
||||
{
|
||||
v3s16 p(x, y, z);
|
||||
MapBlock *block = getBlockNoCreateNoEx(p);
|
||||
assert(block);
|
||||
if (!block)
|
||||
continue;
|
||||
block->setGenerated(true);
|
||||
}
|
||||
|
||||
@ -2444,10 +2448,7 @@ MapBlock* ServerMap::finishBlockMake(BlockMakeData *data,
|
||||
}
|
||||
#endif
|
||||
|
||||
MapBlock *block = getBlockNoCreateNoEx(blockpos_requested);
|
||||
assert(block);
|
||||
|
||||
return block;
|
||||
getBlockNoCreateNoEx(blockpos_requested);
|
||||
}
|
||||
|
||||
ServerMapSector * ServerMap::createSector(v2s16 p2d)
|
||||
@ -3760,7 +3761,7 @@ void ManualMapVoxelManipulator::blitBackAll(
|
||||
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;
|
||||
}
|
||||
|
@ -401,7 +401,7 @@ public:
|
||||
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);
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user