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

Detect air-only blocks instead of day/night differences (#14264)

* Detect air-only blocks instead day/night differences

* Write !is_air into the former day-night-diff bit on disk, so that old server can still read maps written by new servers

* Only set is_air bit when reading from disk
This commit is contained in:
lhofhansl 2024-02-22 21:47:42 -08:00 committed by GitHub
parent 0d30a3071a
commit 0d4b489545
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 52 additions and 75 deletions

View file

@ -354,18 +354,12 @@ void RemoteClient::GetNextBlocks (
continue;
/*
If block is not close, don't send it unless it is near
ground level.
Block is near ground level if night-time mesh
differs from day-time mesh.
If block is not close, don't send it if it
consists of air only.
*/
if (d >= d_opt) {
if (!block->getIsUnderground() && !block->getDayNightDiff())
if (d >= d_opt && block->isAir())
continue;
}
}
/*
Check occlusion cache first.
*/