diff options
author | madmaxoft <github@xoft.cz> | 2014-05-01 22:16:29 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-05-01 22:16:29 +0200 |
commit | 4a952717904436cc92a31505149d1729e2994b68 (patch) | |
tree | d21b857cce4dbac162a597400ab27331a69f1263 /src/WorldStorage/WSSAnvil.cpp | |
parent | Added a missing return statement. (diff) | |
parent | Merge pull request #973 from mc-server/ItemNoCopyConstructor (diff) | |
download | cuberite-4a952717904436cc92a31505149d1729e2994b68.tar cuberite-4a952717904436cc92a31505149d1729e2994b68.tar.gz cuberite-4a952717904436cc92a31505149d1729e2994b68.tar.bz2 cuberite-4a952717904436cc92a31505149d1729e2994b68.tar.lz cuberite-4a952717904436cc92a31505149d1729e2994b68.tar.xz cuberite-4a952717904436cc92a31505149d1729e2994b68.tar.zst cuberite-4a952717904436cc92a31505149d1729e2994b68.zip |
Diffstat (limited to 'src/WorldStorage/WSSAnvil.cpp')
-rw-r--r-- | src/WorldStorage/WSSAnvil.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/WorldStorage/WSSAnvil.cpp b/src/WorldStorage/WSSAnvil.cpp index 33f34728e..f33178173 100644 --- a/src/WorldStorage/WSSAnvil.cpp +++ b/src/WorldStorage/WSSAnvil.cpp @@ -2672,6 +2672,11 @@ bool cWSSAnvil::cMCAFile::SetChunkData(const cChunkCoords & a_Chunk, const AStri return false; } + // Add padding to 4K boundary: + size_t BytesWritten = a_Data.size() + MCA_CHUNK_HEADER_LENGTH; + static const char Padding[4095] = {0}; + m_File.Write(Padding, 4096 - (BytesWritten % 4096)); + // Store the header: ChunkSize = (a_Data.size() + MCA_CHUNK_HEADER_LENGTH + 4095) / 4096; // Round data size *up* to nearest 4KB sector, make it a sector number ASSERT(ChunkSize < 256); |