summaryrefslogtreecommitdiffstats
path: root/src/ChunkBuffer.h
diff options
context:
space:
mode:
authorworktycho <work.tycho@gmail.com>2014-05-17 15:29:15 +0200
committerworktycho <work.tycho@gmail.com>2014-05-17 15:29:15 +0200
commit4e841146b89523b0fe3f8f75b75c97a29b194e21 (patch)
treec6f38fafb3a4538e4ba9ac06cfa363d4839dbf6b /src/ChunkBuffer.h
parentAdd test for zeros (diff)
downloadcuberite-4e841146b89523b0fe3f8f75b75c97a29b194e21.tar
cuberite-4e841146b89523b0fe3f8f75b75c97a29b194e21.tar.gz
cuberite-4e841146b89523b0fe3f8f75b75c97a29b194e21.tar.bz2
cuberite-4e841146b89523b0fe3f8f75b75c97a29b194e21.tar.lz
cuberite-4e841146b89523b0fe3f8f75b75c97a29b194e21.tar.xz
cuberite-4e841146b89523b0fe3f8f75b75c97a29b194e21.tar.zst
cuberite-4e841146b89523b0fe3f8f75b75c97a29b194e21.zip
Diffstat (limited to '')
-rw-r--r--src/ChunkBuffer.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/ChunkBuffer.h b/src/ChunkBuffer.h
index 1f170abba..66edce867 100644
--- a/src/ChunkBuffer.h
+++ b/src/ChunkBuffer.h
@@ -71,6 +71,7 @@ public:
}
other.IsOwner = false;
}
+ return *this;
}
#else
@@ -85,11 +86,15 @@ public:
cChunkBuffer& operator=(const cChunkBuffer&& other)
{
- for (int i = 0; i < CHUNK_SECTION_NUM; i++)
+ if(&other != this)
{
- if(m_Sections[i]) Free(m_Sections[i]);;
- m_Sections[i] = other.m_Sections[i];
+ for (int i = 0; i < CHUNK_SECTION_NUM; i++)
+ {
+ if(m_Sections[i]) Free(m_Sections[i]);;
+ m_Sections[i] = other.m_Sections[i];
+ }
}
+ return *this;
}
#endif