Fix segfault caused by a8e238ed06

master
Perttu Ahola 2015-08-13 19:02:48 +03:00
parent a8e238ed06
commit def274a583
1 changed files with 2 additions and 2 deletions

View File

@ -1499,8 +1499,8 @@ void Map::timerUpdate(float dtime, float unload_timeout, u32 max_loaded_blocks,
}
block_count_all = mapblock_queue.size();
// Delete old blocks, and blocks over the limit from the memory
while (mapblock_queue.size() > max_loaded_blocks
|| mapblock_queue.top().block->getUsageTimer() > unload_timeout) {
while (!mapblock_queue.empty() && (mapblock_queue.size() > max_loaded_blocks
|| mapblock_queue.top().block->getUsageTimer() > unload_timeout)) {
TimeOrderedMapBlock b = mapblock_queue.top();
mapblock_queue.pop();