Fix terrain streaming loop and auto-select single realm/character

Use getRemainingTileCount (pending + readyQueue) and processAllReadyTiles
to prevent loading screen from exiting before tiles are finalized. Auto-select
realm and character when only one is available.
This commit is contained in:
Kelsi 2026-02-06 14:56:26 -08:00
parent 81d712121e
commit aa11ffda72
5 changed files with 68 additions and 15 deletions

View file

@ -661,6 +661,23 @@ void TerrainManager::processReadyTiles() {
}
}
void TerrainManager::processAllReadyTiles() {
while (true) {
std::unique_ptr<PendingTile> pending;
{
std::lock_guard<std::mutex> lock(queueMutex);
if (readyQueue.empty()) break;
pending = std::move(readyQueue.front());
readyQueue.pop();
}
if (pending) {
TileCoord coord = pending->coord;
finalizeTile(std::move(pending));
pendingTiles.erase(coord);
}
}
}
void TerrainManager::unloadTile(int x, int y) {
TileCoord coord = {x, y};