aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorlhofhansl <larsh@apache.org>2023-02-26 14:18:18 -0800
committerGitHub <noreply@github.com>2023-02-26 14:18:18 -0800
commitfe3ea090d17ced157bd8fdd047b6b635a1413a76 (patch)
treee7408857997ba993ef8f85bc28757d4082c06774 /src
parent2083252c05ece1e47c1c476fda2b9eda3bf332a0 (diff)
downloadminetest-fe3ea090d17ced157bd8fdd047b6b635a1413a76.tar.xz
Don't expire blocks visible to the client. (#13255)
Diffstat (limited to 'src')
-rw-r--r--src/clientiface.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/clientiface.cpp b/src/clientiface.cpp
index 23ce7e966..8ae2efada 100644
--- a/src/clientiface.cpp
+++ b/src/clientiface.cpp
@@ -295,12 +295,6 @@ void RemoteClient::GetNextBlocks (
}
/*
- Don't send already sent blocks
- */
- if (m_blocks_sent.find(p) != m_blocks_sent.end())
- continue;
-
- /*
Check if map has this block
*/
MapBlock *block = env->getMap().getBlockNoCreateNoEx(p);
@@ -310,6 +304,12 @@ void RemoteClient::GetNextBlocks (
// Reset usage timer, this block will be of use in the future.
block->resetUsageTimer();
+ /*
+ Don't send already sent blocks
+ */
+ if (m_blocks_sent.find(p) != m_blocks_sent.end())
+ continue;
+
// Check whether the block exists (with data)
if (!block->isGenerated())
block_not_found = true;