fix: multiple savefile fixes

This commit is contained in:
NOTPIES
2026-03-12 00:16:48 -03:00
parent c1a9648bf4
commit ff2cb7b582
13 changed files with 102 additions and 54 deletions

View File

@@ -149,8 +149,10 @@ LevelChunk *ServerChunkCache::create(int x, int z, bool asyncPostProcess) // 4J
if( ( chunk == NULL ) || ( chunk->x != x ) || ( chunk->z != z ) )
{
bool wasLoaded = false;
EnterCriticalSection(&m_csLoadCreate);
chunk = load(x, z);
wasLoaded = (chunk != NULL);
if (chunk == NULL)
{
if (source == NULL)
@@ -470,7 +472,7 @@ void ServerChunkCache::postProcess(ChunkSource *parent, int x, int z )
{
LevelChunk *chunk = getChunk(x, z);
if ( (chunk->terrainPopulated & LevelChunk::sTerrainPopulatedFromHere) == 0 )
{
{
if (source != NULL)
{
PIXBeginNamedEvent(0,"Main post processing");
@@ -478,7 +480,7 @@ void ServerChunkCache::postProcess(ChunkSource *parent, int x, int z )
PIXEndNamedEvent();
chunk->markUnsaved();
}
}
// Flag not only this chunk as being post-processed, but also all the chunks that this post-processing might affect. We can guarantee that these
// chunks exist as that's determined before post-processing can even run