From 67240686599f8106640f231cbad73000287e8a60 Mon Sep 17 00:00:00 2001 From: lhofhansl Date: Mon, 31 Mar 2025 21:31:10 -0700 Subject: [PATCH] Slight fix to #15949 to handle emerge queue full (#15960) Partially restore the existing logic, and try to enqueue a block as before, if the queue is full it will be handled correctly. --- src/server/clientiface.cpp | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/src/server/clientiface.cpp b/src/server/clientiface.cpp index 8a8a6cf1b7..96db69bbea 100644 --- a/src/server/clientiface.cpp +++ b/src/server/clientiface.cpp @@ -343,24 +343,21 @@ void RemoteClient::GetNextBlocks ( const bool want_emerge = !block || !block->isGenerated(); // if the block is already in the emerge queue we don't have to check again - if (want_emerge && emerge->isBlockInQueue(p)) { - nearest_emerged_d = d; - continue; - } + if (!want_emerge || !emerge->isBlockInQueue(p)) { + /* + Check occlusion cache first. + */ + if (m_blocks_occ.find(p) != m_blocks_occ.end()) + continue; - /* - Check occlusion cache first. - */ - if (m_blocks_occ.find(p) != m_blocks_occ.end()) - continue; - - /* - Note that we do this even before the block is loaded as this does not depend on its contents. - */ - if (m_occ_cull && - env->getMap().isBlockOccluded(p * MAP_BLOCKSIZE, cam_pos_nodes, d >= d_cull_opt)) { - m_blocks_occ.insert(p); - continue; + /* + Note that we do this even before the block is loaded as this does not depend on its contents. + */ + if (m_occ_cull && + env->getMap().isBlockOccluded(p * MAP_BLOCKSIZE, cam_pos_nodes, d >= d_cull_opt)) { + m_blocks_occ.insert(p); + continue; + } } /*