mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-03-26 09:48:13 +05:00
Memory leak fix: Make chunks unload properly (#1406)
* Fix chunk unload and cleanup logic, fixes #1347 * Applying formatting to code I edited 😝
This commit is contained in:
@@ -1690,7 +1690,16 @@ bool PlayerList::isXuidBanned(PlayerUID xuid)
|
||||
}
|
||||
|
||||
// AP added for Vita so the range can be increased once the level starts
|
||||
void PlayerList::setViewDistance(int newViewDistance)
|
||||
void PlayerList::setViewDistance(const int newViewDistance)
|
||||
{
|
||||
viewDistance = newViewDistance;
|
||||
|
||||
for (size_t i = 0; i < server->levels.length; i++)
|
||||
{
|
||||
ServerLevel* level = server->levels[i];
|
||||
if (level != nullptr)
|
||||
{
|
||||
level->getChunkMap()->setRadius(newViewDistance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user