summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-04-22 13:34:32 +0200
committerMattes D <github@xoft.cz>2014-04-22 13:34:32 +0200
commit6492aa000b322877aecda32573cc55b57abfc5ed (patch)
treef9f0f9211b42aa72729f8d6d444e4f48556e5fb9 /src/WorldStorage
parentAdded prefab hitboxes. (diff)
parentreverted the revert of the minecart collision detection fix. (diff)
downloadcuberite-6492aa000b322877aecda32573cc55b57abfc5ed.tar
cuberite-6492aa000b322877aecda32573cc55b57abfc5ed.tar.gz
cuberite-6492aa000b322877aecda32573cc55b57abfc5ed.tar.bz2
cuberite-6492aa000b322877aecda32573cc55b57abfc5ed.tar.lz
cuberite-6492aa000b322877aecda32573cc55b57abfc5ed.tar.xz
cuberite-6492aa000b322877aecda32573cc55b57abfc5ed.tar.zst
cuberite-6492aa000b322877aecda32573cc55b57abfc5ed.zip
Diffstat (limited to 'src/WorldStorage')
-rw-r--r--src/WorldStorage/FastNBT.cpp4
-rw-r--r--src/WorldStorage/WSSCompact.cpp2
-rw-r--r--src/WorldStorage/WSSCompact.h2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/WorldStorage/FastNBT.cpp b/src/WorldStorage/FastNBT.cpp
index be25fd1a4..ac9a21205 100644
--- a/src/WorldStorage/FastNBT.cpp
+++ b/src/WorldStorage/FastNBT.cpp
@@ -345,7 +345,7 @@ cFastNBTWriter::cFastNBTWriter(const AString & a_RootTagName) :
void cFastNBTWriter::BeginCompound(const AString & a_Name)
{
- if (m_CurrentStack >= MAX_STACK)
+ if (m_CurrentStack >= MAX_STACK - 1)
{
ASSERT(!"Stack overflow");
return;
@@ -376,7 +376,7 @@ void cFastNBTWriter::EndCompound(void)
void cFastNBTWriter::BeginList(const AString & a_Name, eTagType a_ChildrenType)
{
- if (m_CurrentStack >= MAX_STACK)
+ if (m_CurrentStack >= MAX_STACK - 1)
{
ASSERT(!"Stack overflow");
return;
diff --git a/src/WorldStorage/WSSCompact.cpp b/src/WorldStorage/WSSCompact.cpp
index bb9d4b9e6..5435e6d5a 100644
--- a/src/WorldStorage/WSSCompact.cpp
+++ b/src/WorldStorage/WSSCompact.cpp
@@ -839,7 +839,7 @@ void cWSSCompact::cPAKFile::UpdateChunk2To3()
-bool cWSSCompact::LoadChunkFromData(const cChunkCoords & a_Chunk, int & a_UncompressedSize, const AString & a_Data, cWorld * a_World)
+bool cWSSCompact::LoadChunkFromData(const cChunkCoords & a_Chunk, int a_UncompressedSize, const AString & a_Data, cWorld * a_World)
{
// Crude data integrity check:
if (a_UncompressedSize < cChunkDef::BlockDataSize)
diff --git a/src/WorldStorage/WSSCompact.h b/src/WorldStorage/WSSCompact.h
index 4df146ec3..97e3b82f9 100644
--- a/src/WorldStorage/WSSCompact.h
+++ b/src/WorldStorage/WSSCompact.h
@@ -135,7 +135,7 @@ protected:
bool EraseChunkData(const cChunkCoords & a_Chunk);
/// Loads the chunk from the data (no locking needed)
- bool LoadChunkFromData(const cChunkCoords & a_Chunk, int & a_UncompressedSize, const AString & a_Data, cWorld * a_World);
+ bool LoadChunkFromData(const cChunkCoords & a_Chunk, int a_UncompressedSize, const AString & a_Data, cWorld * a_World);
void LoadEntitiesFromJson(Json::Value & a_Value, cEntityList & a_Entities, cBlockEntityList & a_BlockEntities, cWorld * a_World);