diff options
author | madmaxoft <github@xoft.cz> | 2014-05-01 18:00:10 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-05-01 18:00:10 +0200 |
commit | 772b57ca04b2dbe4ec163a8c2856f8af7bc5c2a5 (patch) | |
tree | 283e911a9d47627f3e82173974bdd5eaca427a5c /src/WorldStorage | |
parent | If webadmin.ini doesn't exist, example one is written immediately. (diff) | |
download | cuberite-772b57ca04b2dbe4ec163a8c2856f8af7bc5c2a5.tar cuberite-772b57ca04b2dbe4ec163a8c2856f8af7bc5c2a5.tar.gz cuberite-772b57ca04b2dbe4ec163a8c2856f8af7bc5c2a5.tar.bz2 cuberite-772b57ca04b2dbe4ec163a8c2856f8af7bc5c2a5.tar.lz cuberite-772b57ca04b2dbe4ec163a8c2856f8af7bc5c2a5.tar.xz cuberite-772b57ca04b2dbe4ec163a8c2856f8af7bc5c2a5.tar.zst cuberite-772b57ca04b2dbe4ec163a8c2856f8af7bc5c2a5.zip |
Diffstat (limited to '')
-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); |