aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/MultiPlayerChunkCache.cpp
diff options
context:
space:
mode:
authorvoid_17 <61356189+void2012@users.noreply.github.com>2026-03-06 02:11:18 +0700
committerGitHub <noreply@github.com>2026-03-06 02:11:18 +0700
commit55231bb8d3e1a4e2752ac3d444c4287eb0ca4e8b (patch)
tree953c537a5c66e328e9f4ab29626cf738112d53c0 /Minecraft.Client/MultiPlayerChunkCache.cpp
parent7d6658fe5b3095f35093701b5ab669ffc291e875 (diff)
Remove AUTO_VAR macro and _toString function (#592)
Diffstat (limited to 'Minecraft.Client/MultiPlayerChunkCache.cpp')
-rw-r--r--Minecraft.Client/MultiPlayerChunkCache.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/Minecraft.Client/MultiPlayerChunkCache.cpp b/Minecraft.Client/MultiPlayerChunkCache.cpp
index b5e1dd25..a4c200be 100644
--- a/Minecraft.Client/MultiPlayerChunkCache.cpp
+++ b/Minecraft.Client/MultiPlayerChunkCache.cpp
@@ -105,11 +105,13 @@ MultiPlayerChunkCache::~MultiPlayerChunkCache()
delete cache;
delete hasData;
- AUTO_VAR(itEnd, loadedChunkList.end());
- for (AUTO_VAR(it, loadedChunkList.begin()); it != itEnd; it++)
- delete *it;
+ for (auto& it : loadedChunkList)
+ {
+ if ( it )
+ delete it;
+ }
- DeleteCriticalSection(&m_csLoadCreate);
+ DeleteCriticalSection(&m_csLoadCreate);
}
@@ -146,7 +148,7 @@ void MultiPlayerChunkCache::drop(int x, int z)
{
// Added parameter here specifies that we don't want to delete tile entities, as they won't get recreated unless they've got update packets
// The tile entities are in general only created on the client by virtue of the chunk rebuild
- chunk->unload(false);
+ chunk->unload(false);
// 4J - We just want to clear out the entities in the chunk, but everything else should be valid
chunk->loaded = true;
@@ -174,7 +176,7 @@ LevelChunk *MultiPlayerChunkCache::create(int x, int z)
// 4J-JEV: We are about to use shared data, abort if the server is stopped and the data is deleted.
if (MinecraftServer::getInstance()->serverHalted()) return NULL;
- // If we're the host, then don't create the chunk, share data from the server's copy
+ // If we're the host, then don't create the chunk, share data from the server's copy
#ifdef _LARGE_WORLDS
LevelChunk *serverChunk = MinecraftServer::getInstance()->getLevel(level->dimension->id)->cache->getChunkLoadedOrUnloaded(x,z);
#else
@@ -193,7 +195,7 @@ LevelChunk *MultiPlayerChunkCache::create(int x, int z)
chunk = new LevelChunk(level, bytes, x, z);
// 4J - changed to use new methods for lighting
- chunk->setSkyLightDataAllBright();
+ chunk->setSkyLightDataAllBright();
// Arrays::fill(chunk->skyLight->data, (byte) 255);
}
@@ -294,7 +296,7 @@ wstring MultiPlayerChunkCache::gatherStats()
EnterCriticalSection(&m_csLoadCreate);
int size = (int)loadedChunkList.size();
LeaveCriticalSection(&m_csLoadCreate);
- return L"MultiplayerChunkCache: " + _toString<int>(size);
+ return L"MultiplayerChunkCache: " + std::to_wstring(size);
}