Skip to content

Commit

Permalink
Fix for #13255: Check if client has a block even if the server has un…
Browse files Browse the repository at this point in the history
…loaded it. (#13256)
  • Loading branch information
lhofhansl authored Feb 27, 2023
1 parent fe3ea09 commit fbbdae9
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/clientiface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit fbbdae9

Please sign in to comment.