mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-22 17:18:39 +00:00
Check if a block is already in the emege queue before checking occlusion culling and trying to reemerge (#15949)
This commit is contained in:
parent
b0bc6ce637
commit
8f8d7c4088
1 changed files with 10 additions and 1 deletions
|
@ -339,6 +339,15 @@ void RemoteClient::GetNextBlocks (
|
||||||
if (d >= d_opt && block->isAir())
|
if (d >= d_opt && block->isAir())
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Check occlusion cache first.
|
Check occlusion cache first.
|
||||||
*/
|
*/
|
||||||
|
@ -357,7 +366,7 @@ void RemoteClient::GetNextBlocks (
|
||||||
/*
|
/*
|
||||||
Add inexistent block to emerge queue.
|
Add inexistent block to emerge queue.
|
||||||
*/
|
*/
|
||||||
if (!block || !block->isGenerated()) {
|
if (want_emerge) {
|
||||||
if (emerge->enqueueBlockEmerge(peer_id, p, generate)) {
|
if (emerge->enqueueBlockEmerge(peer_id, p, generate)) {
|
||||||
if (nearest_emerged_d == -1)
|
if (nearest_emerged_d == -1)
|
||||||
nearest_emerged_d = d;
|
nearest_emerged_d = d;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue