File tree 2 files changed +8
-7
lines changed
2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -2312,7 +2312,7 @@ void ServerMap::finishBlockMake(BlockMakeData *data,
2312
2312
{
2313
2313
// 70ms @cs=8
2314
2314
// TimeTaker timer("finishBlockMake() blitBackAll");
2315
- data->vmanip ->blitBackAll (&changed_blocks);
2315
+ data->vmanip ->blitBackAll (&changed_blocks, false );
2316
2316
}
2317
2317
2318
2318
EMERGE_DBG_OUT (" finishBlockMake: changed_blocks.size()=" << changed_blocks.size ());
@@ -3586,7 +3586,8 @@ void ManualMapVoxelManipulator::initialEmerge(v3s16 blockpos_min,
3586
3586
}
3587
3587
3588
3588
void ManualMapVoxelManipulator::blitBackAll (
3589
- std::map<v3s16, MapBlock*> * modified_blocks)
3589
+ std::map<v3s16, MapBlock*> *modified_blocks,
3590
+ bool overwrite_generated)
3590
3591
{
3591
3592
if (m_area.getExtent () == v3s16 (0 ,0 ,0 ))
3592
3593
return ;
@@ -3601,10 +3602,9 @@ void ManualMapVoxelManipulator::blitBackAll(
3601
3602
v3s16 p = i->first ;
3602
3603
MapBlock *block = m_map->getBlockNoCreateNoEx (p);
3603
3604
bool existed = !(i->second & VMANIP_BLOCK_DATA_INEXIST);
3604
- if ((existed == false ) || (block == NULL ))
3605
- {
3605
+ if ((existed == false ) || (block == NULL ) ||
3606
+ (overwrite_generated == false && block-> isGenerated () == true ))
3606
3607
continue ;
3607
- }
3608
3608
3609
3609
block->copyFrom (*this );
3610
3610
Original file line number Diff line number Diff line change @@ -543,10 +543,11 @@ class ManualMapVoxelManipulator : public VoxelManipulator
543
543
{m_map = map;}
544
544
545
545
void initialEmerge (v3s16 blockpos_min, v3s16 blockpos_max,
546
- bool load_if_inexistent = true );
546
+ bool load_if_inexistent = true );
547
547
548
548
// This is much faster with big chunks of generated data
549
- void blitBackAll (std::map<v3s16, MapBlock*> * modified_blocks);
549
+ void blitBackAll (std::map<v3s16, MapBlock*> * modified_blocks,
550
+ bool overwrite_generated = true );
550
551
551
552
protected:
552
553
bool m_create_area;
You can’t perform that action at this time.
0 commit comments