mirror of
https://github.com/mehah/otclient
synced 2026-08-15 16:29:06 -04:00
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:
parent
cec65014fc
commit
9bc2612cc5
1 changed files with 7 additions and 3 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue