diff options
| author | Loki Rautio <lokirautio@gmail.com> | 2026-03-07 21:12:22 -0600 |
|---|---|---|
| committer | Loki Rautio <lokirautio@gmail.com> | 2026-03-07 21:12:22 -0600 |
| commit | 087b7e7abfe81dd7f0fdcdea36ac9f245950df1a (patch) | |
| tree | 69454763e73ca764af4e682d3573080b13138a0e /Minecraft.Client/MultiPlayerChunkCache.cpp | |
| parent | a9be52c41a02d207233199e98898fe7483d7e817 (diff) | |
Revert "Project modernization (#630)"
This code was not tested and breaks in Release builds, reverting to restore
functionality of the nightly. All in-game menus do not work and generating
a world crashes.
This reverts commit a9be52c41a02d207233199e98898fe7483d7e817.
Diffstat (limited to 'Minecraft.Client/MultiPlayerChunkCache.cpp')
| -rw-r--r-- | Minecraft.Client/MultiPlayerChunkCache.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/Minecraft.Client/MultiPlayerChunkCache.cpp b/Minecraft.Client/MultiPlayerChunkCache.cpp index 62361ce3..a4c200be 100644 --- a/Minecraft.Client/MultiPlayerChunkCache.cpp +++ b/Minecraft.Client/MultiPlayerChunkCache.cpp @@ -65,7 +65,7 @@ MultiPlayerChunkCache::MultiPlayerChunkCache(Level *level) { if( y >= 3 ) { - static_cast<WaterLevelChunk *>(waterChunk)->setLevelChunkBrightness(LightLayer::Sky,x,y,z,15); + ((WaterLevelChunk *)waterChunk)->setLevelChunkBrightness(LightLayer::Sky,x,y,z,15); } } } @@ -77,18 +77,18 @@ MultiPlayerChunkCache::MultiPlayerChunkCache(Level *level) { if( y >= ( level->getSeaLevel() - 1 ) ) { - static_cast<WaterLevelChunk *>(waterChunk)->setLevelChunkBrightness(LightLayer::Sky,x,y,z,15); + ((WaterLevelChunk *)waterChunk)->setLevelChunkBrightness(LightLayer::Sky,x,y,z,15); } else { - static_cast<WaterLevelChunk *>(waterChunk)->setLevelChunkBrightness(LightLayer::Sky,x,y,z,2); + ((WaterLevelChunk *)waterChunk)->setLevelChunkBrightness(LightLayer::Sky,x,y,z,2); } } } } else { - waterChunk = nullptr; + waterChunk = NULL; } this->level = level; @@ -132,7 +132,7 @@ bool MultiPlayerChunkCache::reallyHasChunk(int x, int z) int idx = ix * XZSIZE + iz; LevelChunk *chunk = cache[idx]; - if( chunk == nullptr ) + if( chunk == NULL ) { return false; } @@ -166,7 +166,7 @@ LevelChunk *MultiPlayerChunkCache::create(int x, int z) LevelChunk *chunk = cache[idx]; LevelChunk *lastChunk = chunk; - if( chunk == nullptr ) + if( chunk == NULL ) { EnterCriticalSection(&m_csLoadCreate); @@ -174,7 +174,7 @@ LevelChunk *MultiPlayerChunkCache::create(int x, int z) if( g_NetworkManager.IsHost() ) // force here to disable sharing of data { // 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 nullptr; + if (MinecraftServer::getInstance()->serverHalted()) return NULL; // If we're the host, then don't create the chunk, share data from the server's copy #ifdef _LARGE_WORLDS @@ -248,7 +248,7 @@ LevelChunk *MultiPlayerChunkCache::getChunk(int x, int z) int idx = ix * XZSIZE + iz; LevelChunk *chunk = cache[idx]; - if( chunk == nullptr ) + if( chunk == NULL ) { return emptyChunk; } @@ -279,12 +279,12 @@ void MultiPlayerChunkCache::postProcess(ChunkSource *parent, int x, int z) vector<Biome::MobSpawnerData *> *MultiPlayerChunkCache::getMobsAt(MobCategory *mobCategory, int x, int y, int z) { - return nullptr; + return NULL; } TilePos *MultiPlayerChunkCache::findNearestMapFeature(Level *level, const wstring &featureName, int x, int y, int z) { - return nullptr; + return NULL; } void MultiPlayerChunkCache::recreateLogicStructuresForChunk(int chunkX, int chunkZ) @@ -294,7 +294,7 @@ void MultiPlayerChunkCache::recreateLogicStructuresForChunk(int chunkX, int chun wstring MultiPlayerChunkCache::gatherStats() { EnterCriticalSection(&m_csLoadCreate); - int size = static_cast<int>(loadedChunkList.size()); + int size = (int)loadedChunkList.size(); LeaveCriticalSection(&m_csLoadCreate); return L"MultiplayerChunkCache: " + std::to_wstring(size); |
