aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorlhofhansl <larsh@apache.org>2023-02-27 09:57:03 -0800
committerGitHub <noreply@github.com>2023-02-27 09:57:03 -0800
commitfbbdae93ee324584089efaf8e880a1378f6a2ad6 (patch)
tree80e5c07e6f31021381229cd3cd56ecda61bbaf56 /src
parentfe3ea090d17ced157bd8fdd047b6b635a1413a76 (diff)
downloadminetest-fbbdae93ee324584089efaf8e880a1378f6a2ad6.tar.xz
Fix for #13255: Check if client has a block even if the server has unloaded it. (#13256)
Diffstat (limited to 'src')
-rw-r--r--src/clientiface.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/clientiface.cpp b/src/clientiface.cpp
index 8ae2efada..9d1a6cd03 100644
--- a/src/clientiface.cpp
+++ b/src/clientiface.cpp
@@ -298,18 +298,19 @@ void RemoteClient::GetNextBlocks (
Check if map has this block
*/
MapBlock *block = env->getMap().getBlockNoCreateNoEx(p);
-
- bool block_not_found = false;
if (block) {
- // Reset usage timer, this block will be of use in the future.
+ // First: 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;
+ /*
+ Don't send already sent blocks
+ */
+ if (m_blocks_sent.find(p) != m_blocks_sent.end())
+ continue;
+ bool block_not_found = false;
+ if (block) {
// Check whether the block exists (with data)
if (!block->isGenerated())
block_not_found = true;