fix: client crashes when logging back in after an AFK kick (#1799)

Bug Fixes:
- Improved map floor visibility updates when no tiles are available.
- Prevented invalid floor-range calculations during map refreshes.
- Ensured cached visible tiles are cleared consistently across all floors.
This commit is contained in:
mimus-assa 2026-08-14 17:05:41 -06:00 committed by GitHub
parent cec65014fc
commit 9bc2612cc5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -310,9 +310,13 @@ void MapView::updateVisibleTiles()
return;
// clear current visible tiles cache
do {
m_floors[m_floorMin].cachedVisibleTiles.clear();
} while (++m_floorMin <= m_floorMax);
for (uint8_t z = m_floorMin; z <= m_floorMax; ++z)
m_floors[z].cachedVisibleTiles.clear();
// empty range, recomputed below. m_floorMin must never be used as the loop
// counter itself: when no tile is added and the camera does not move, nothing
// restores it and it walks past the end of m_floors.
m_floorMin = m_floorMax + 1;
m_lockedFirstVisibleFloor = m_floorViewMode == Otc::LOCKED ? m_posInfo.camera.z : -1;