@@ -298,20 +298,14 @@ void RemoteClient::GetNextBlocks (
298
298
*/
299
299
MapBlock *block = env->getMap ().getBlockNoCreateNoEx (p);
300
300
301
- bool surely_not_found_on_disk = false ;
302
- bool block_is_invalid = false ;
301
+ bool block_not_found = false ;
303
302
if (block) {
304
303
// Reset usage timer, this block will be of use in the future.
305
304
block->resetUsageTimer ();
306
305
307
- // Block is dummy if data doesn't exist.
308
- // It means it has been not found from disk and not generated
309
- if (block->isDummy ()) {
310
- surely_not_found_on_disk = true ;
311
- }
312
-
313
- if (!block->isGenerated ())
314
- block_is_invalid = true ;
306
+ // Check whether the block exists (with data)
307
+ if (block->isDummy () || !block->isGenerated ())
308
+ block_not_found = true ;
315
309
316
310
/*
317
311
If block is not close, don't send it unless it is near
@@ -325,7 +319,7 @@ void RemoteClient::GetNextBlocks (
325
319
continue ;
326
320
}
327
321
328
- if (m_occ_cull && !block_is_invalid &&
322
+ if (m_occ_cull && !block_not_found &&
329
323
env->getMap ().isBlockOccluded (block, cam_pos_nodes)) {
330
324
continue ;
331
325
}
@@ -335,15 +329,15 @@ void RemoteClient::GetNextBlocks (
335
329
If block has been marked to not exist on disk (dummy) or is
336
330
not generated and generating new ones is not wanted, skip block.
337
331
*/
338
- if (!generate && (surely_not_found_on_disk || block_is_invalid) ) {
332
+ if (!generate && block_not_found ) {
339
333
// get next one.
340
334
continue ;
341
335
}
342
336
343
337
/*
344
338
Add inexistent block to emerge queue.
345
339
*/
346
- if (block == NULL || surely_not_found_on_disk || block_is_invalid ) {
340
+ if (block == NULL || block_not_found ) {
347
341
if (emerge->enqueueBlockEmerge (peer_id, p, generate)) {
348
342
if (nearest_emerged_d == -1 )
349
343
nearest_emerged_d = d;
0 commit comments