diff options
author | worktycho <work.tycho@gmail.com> | 2014-05-17 15:29:15 +0200 |
---|---|---|
committer | worktycho <work.tycho@gmail.com> | 2014-05-17 15:29:15 +0200 |
commit | 4e841146b89523b0fe3f8f75b75c97a29b194e21 (patch) | |
tree | c6f38fafb3a4538e4ba9ac06cfa363d4839dbf6b /src | |
parent | Add test for zeros (diff) | |
download | cuberite-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 'src')
-rw-r--r-- | src/ChunkBuffer.h | 11 |
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 |