diff options
| author | Loki Rautio <lokirautio@gmail.com> | 2026-03-26 01:37:23 -0500 |
|---|---|---|
| committer | Loki Rautio <lokirautio@gmail.com> | 2026-03-26 01:37:23 -0500 |
| commit | dee559bd16e5fc4fb1d8cdd16e7e3924666b01c9 (patch) | |
| tree | 022e5c18632e86d272c3d0a02532b110c8dbb956 /Minecraft.Client/PlayerChunkMap.cpp | |
| parent | a24318eedc44af2f5967c4727b7ebf578b8e233a (diff) | |
Revert "Memory leak fix: Make chunks unload properly (#1406)"
This reverts commit a24318eedc44af2f5967c4727b7ebf578b8e233a.
This fix introduces broken behavior for dedicated servers. It will be
merged back in once the related issue is fixed
Diffstat (limited to 'Minecraft.Client/PlayerChunkMap.cpp')
| -rw-r--r-- | Minecraft.Client/PlayerChunkMap.cpp | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/Minecraft.Client/PlayerChunkMap.cpp b/Minecraft.Client/PlayerChunkMap.cpp index ddf2bae2..bcc3f6ba 100644 --- a/Minecraft.Client/PlayerChunkMap.cpp +++ b/Minecraft.Client/PlayerChunkMap.cpp @@ -792,14 +792,6 @@ void PlayerChunkMap::setRadius(int newRadius) int xc = static_cast<int>(player->x) >> 4; int zc = static_cast<int>(player->z) >> 4; - for (auto it = addRequests.begin(); it != addRequests.end(); ) - { - if (it->player == player) - it = addRequests.erase(it); - else - ++it; - } - for (int x = xc - newRadius; x <= xc + newRadius; x++) for (int z = zc - newRadius; z <= zc + newRadius; z++) { @@ -809,26 +801,9 @@ void PlayerChunkMap::setRadius(int newRadius) getChunkAndAddPlayer(x, z, player); } } - - // Remove chunks that are outside the new radius - for (int x = xc - radius; x <= xc + radius; x++) - { - for (int z = zc - radius; z <= zc + radius; z++) - { - if (x < xc - newRadius || x > xc + newRadius || z < zc - newRadius || z > zc + newRadius) - { - getChunkAndRemovePlayer(x, z, player); - } - } - } } } - if (newRadius < radius) - { - level->cache->dropAll(); - } - assert(radius <= MAX_VIEW_DISTANCE); assert(radius >= MIN_VIEW_DISTANCE); this->radius = newRadius; |
