mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 10:03:45 +01:00
Slight simplification of RemoteClient::getNextBlocks(...) (#14302)
This commit is contained in:
parent
4468813d47
commit
2ef080a51b
@ -345,11 +345,13 @@ void RemoteClient::GetNextBlocks (
|
|||||||
if (m_blocks_sent.find(p) != m_blocks_sent.end())
|
if (m_blocks_sent.find(p) != m_blocks_sent.end())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
bool block_not_found = false;
|
|
||||||
if (block) {
|
if (block) {
|
||||||
// Check whether the block exists (with data)
|
/*
|
||||||
if (!block->isGenerated())
|
If block is not generated and generating new ones is
|
||||||
block_not_found = true;
|
not wanted, skip block.
|
||||||
|
*/
|
||||||
|
if (!block->isGenerated() && !generate)
|
||||||
|
continue;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
If block is not close, don't send it unless it is near
|
If block is not close, don't send it unless it is near
|
||||||
@ -379,19 +381,10 @@ void RemoteClient::GetNextBlocks (
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
If block has been marked to not exist on disk (dummy) or is
|
|
||||||
not generated and generating new ones is not wanted, skip block.
|
|
||||||
*/
|
|
||||||
if (!generate && block_not_found) {
|
|
||||||
// get next one.
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Add inexistent block to emerge queue.
|
Add inexistent block to emerge queue.
|
||||||
*/
|
*/
|
||||||
if (block == NULL || block_not_found) {
|
if (!block || !block->isGenerated()) {
|
||||||
if (emerge->enqueueBlockEmerge(peer_id, p, generate)) {
|
if (emerge->enqueueBlockEmerge(peer_id, p, generate)) {
|
||||||
if (nearest_emerged_d == -1)
|
if (nearest_emerged_d == -1)
|
||||||
nearest_emerged_d = d;
|
nearest_emerged_d = d;
|
||||||
|
Loading…
Reference in New Issue
Block a user