mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-01 17:38:41 +00:00
Perform server occlusion check before a block is loaded or generated (#14148)
This commit is contained in:
parent
edd947b645
commit
22a1653702
4 changed files with 29 additions and 17 deletions
|
@ -350,18 +350,21 @@ void RemoteClient::GetNextBlocks (
|
|||
if (!block->getIsUnderground() && !block->getDayNightDiff())
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
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;
|
||||
|
||||
if (m_occ_cull && !block_not_found &&
|
||||
env->getMap().isBlockOccluded(block, 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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue