1
0
Fork 0
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:
sfan5 2025-06-23 12:33:10 +02:00
parent 6545710c8e
commit 2733df78c4

View file

@ -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
*/