summaryrefslogtreecommitdiffstats
path: root/src/ChunkBuffer.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ChunkBuffer.h')
-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