mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-05-17 07:53:50 +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:
parent
993052409a
commit
a24318eedc
4 changed files with 68 additions and 46 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue