summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-09-04 14:00:54 +0200
committermadmaxoft <github@xoft.cz>2014-09-04 14:01:06 +0200
commitd77221c7157a7a371cdbc7b00abe287199be3c86 (patch)
tree6334f3b70c08591d4a8b93d8d73cbfbe2df4fb4d /src/WorldStorage
parentRevert "Globals.h: Added Floor and Ciel casting, C++ cast cleanups, etc" (diff)
downloadcuberite-d77221c7157a7a371cdbc7b00abe287199be3c86.tar
cuberite-d77221c7157a7a371cdbc7b00abe287199be3c86.tar.gz
cuberite-d77221c7157a7a371cdbc7b00abe287199be3c86.tar.bz2
cuberite-d77221c7157a7a371cdbc7b00abe287199be3c86.tar.lz
cuberite-d77221c7157a7a371cdbc7b00abe287199be3c86.tar.xz
cuberite-d77221c7157a7a371cdbc7b00abe287199be3c86.tar.zst
cuberite-d77221c7157a7a371cdbc7b00abe287199be3c86.zip
Diffstat (limited to '')
-rw-r--r--src/WorldStorage/WSSAnvil.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/WorldStorage/WSSAnvil.cpp b/src/WorldStorage/WSSAnvil.cpp
index 239f4a155..4d2f92173 100644
--- a/src/WorldStorage/WSSAnvil.cpp
+++ b/src/WorldStorage/WSSAnvil.cpp
@@ -2905,7 +2905,13 @@ bool cWSSAnvil::cMCAFile::SetChunkData(const cChunkCoords & a_Chunk, const AStri
// Store the header:
ChunkSize = ((u_long)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);
+ if (ChunkSize > 255)
+ {
+ LOGWARNING("Cannot save chunk [%d, %d], the data is too large (%u KiB, maximum is 1024 KiB). Remove some entities and retry.",
+ a_Chunk.m_ChunkX, a_Chunk.m_ChunkZ, (unsigned)(ChunkSize * 4)
+ );
+ return false;
+ }
m_Header[LocalX + 32 * LocalZ] = htonl((ChunkSector << 8) | ChunkSize);
if (m_File.Seek(0) < 0)
{