I'm still looking at what's going on and changing stuff (not committing).
I noticed in cChunkMap::cChunkLayer::UnloadUnusedChunks() that it unloads chunks without saving, would queuing them for saving result in what you're saying?
EDIT: I just added World->GetStorage().QueueSaveChunk(m_Chunks[i]); before m_Chunks[i].reset() and it saves it just fine after some tests.
However maybe it would once in a while unload a chunk before saving it, and losing the changes?
I noticed in cChunkMap::cChunkLayer::UnloadUnusedChunks() that it unloads chunks without saving, would queuing them for saving result in what you're saying?
EDIT: I just added World->GetStorage().QueueSaveChunk(m_Chunks[i]); before m_Chunks[i].reset() and it saves it just fine after some tests.
However maybe it would once in a while unload a chunk before saving it, and losing the changes?