1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

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.
This commit is contained in:
lhofhansl 2025-03-31 21:31:10 -07:00 committed by GitHub
parent 1281173e50
commit 6724068659
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -343,24 +343,21 @@ void RemoteClient::GetNextBlocks (
const bool want_emerge = !block || !block->isGenerated(); const bool want_emerge = !block || !block->isGenerated();
// if the block is already in the emerge queue we don't have to check again // if the block is already in the emerge queue we don't have to check again
if (want_emerge && emerge->isBlockInQueue(p)) { if (!want_emerge || !emerge->isBlockInQueue(p)) {
nearest_emerged_d = d; /*
continue; Check occlusion cache first.
} */
if (m_blocks_occ.find(p) != m_blocks_occ.end())
continue;
/* /*
Check occlusion cache first. Note that we do this even before the block is loaded as this does not depend on its contents.
*/ */
if (m_blocks_occ.find(p) != m_blocks_occ.end()) if (m_occ_cull &&
continue; 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;
} }
/* /*