]> git.lizzy.rs Git - minetest.git/commitdiff
Don't expire blocks visible to the client. (#13255)
authorlhofhansl <larsh@apache.org>
Sun, 26 Feb 2023 22:18:18 +0000 (14:18 -0800)
committerGitHub <noreply@github.com>
Sun, 26 Feb 2023 22:18:18 +0000 (14:18 -0800)
src/clientiface.cpp

index 23ce7e966bd53543e0d744e95a14692552e1d6d9..8ae2efada1e14e3605390a720d38dbf35d333da0 100644 (file)
@@ -294,12 +294,6 @@ void RemoteClient::GetNextBlocks (
                                continue;
                        }
 
-                       /*
-                               Don't send already sent blocks
-                       */
-                       if (m_blocks_sent.find(p) != m_blocks_sent.end())
-                               continue;
-
                        /*
                                Check if map has this block
                        */
@@ -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;