mirror of
https://gitea.ibatv.xyz/LegacyConsoleArchive/MCLCE-MinecraftConsoles.git
synced 2026-11-29 07:01:34 +00: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:
1 parent
993052409a
commit
a24318eedc
4 files changed
+68
-46
No files matched your search
@@ -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