mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Skip pointless meshgen updates for air blocks
This commit is contained in:
parent
6545710c8e
commit
2733df78c4
1 changed files with 12 additions and 0 deletions
|
@ -112,6 +112,18 @@ bool MeshUpdateQueue::addBlock(Map *map, v3s16 p, bool ack_block_to_server,
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Air blocks won't suddenly become visible due to a neighbor update, so
|
||||
skip those.
|
||||
Note: this can be extended with more precise checks in the future
|
||||
*/
|
||||
if (from_neighbor && mesh_grid.cell_size == 1 && main_block->isAir()) {
|
||||
assert(!ack_block_to_server);
|
||||
m_urgents.erase(mesh_position);
|
||||
g_profiler->add("MeshUpdateQueue: updates skipped", 1);
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
Add the block
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue