summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2014-05-10 18:46:49 +0200
committerTycho <work.tycho+git@gmail.com>2014-05-10 18:46:49 +0200
commit0adb5c94b8230b7a65fc06f90c253576755cedcd (patch)
tree020c61271d00d0978b8ed799243bb8e1f7ad8474 /src
parentAdd arries copies tests (diff)
downloadcuberite-0adb5c94b8230b7a65fc06f90c253576755cedcd.tar
cuberite-0adb5c94b8230b7a65fc06f90c253576755cedcd.tar.gz
cuberite-0adb5c94b8230b7a65fc06f90c253576755cedcd.tar.bz2
cuberite-0adb5c94b8230b7a65fc06f90c253576755cedcd.tar.lz
cuberite-0adb5c94b8230b7a65fc06f90c253576755cedcd.tar.xz
cuberite-0adb5c94b8230b7a65fc06f90c253576755cedcd.tar.zst
cuberite-0adb5c94b8230b7a65fc06f90c253576755cedcd.zip
Diffstat (limited to 'src')
-rw-r--r--src/ChunkBuffer.cpp6
-rw-r--r--src/ChunkBuffer.h4
2 files changed, 5 insertions, 5 deletions
diff --git a/src/ChunkBuffer.cpp b/src/ChunkBuffer.cpp
index a41b8f61a..baeeff890 100644
--- a/src/ChunkBuffer.cpp
+++ b/src/ChunkBuffer.cpp
@@ -35,7 +35,7 @@ void cChunkBuffer::CopyBlocks (BLOCKTYPE * a_dest, size_t a_Idx, size_t length
memcpy(
&a_dest[i * segment_length],
&m_Sections[i]->m_BlockTypes,
- sizeof(BLOCKTYPE) * length
+ sizeof(BLOCKTYPE) * tocopy
);
}
else
@@ -43,7 +43,7 @@ void cChunkBuffer::CopyBlocks (BLOCKTYPE * a_dest, size_t a_Idx, size_t length
memset(
&a_dest[i * segment_length],
0,
- sizeof(BLOCKTYPE) * length
+ sizeof(BLOCKTYPE) * tocopy
);
}
}
@@ -141,7 +141,7 @@ void cChunkBuffer::SetBlocks(const BLOCKTYPE * a_src)
{
for (size_t i = 0; i < CHUNK_SECTION_NUM; i++)
{
- const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16 / 2;
+ const size_t segment_length = CHUNK_SECTION_HEIGHT * 16 * 16;
if (m_Sections[i])
{
memcpy(&m_Sections[i]->m_BlockTypes, &a_src[i * segment_length], sizeof(BLOCKTYPE) * segment_length);
diff --git a/src/ChunkBuffer.h b/src/ChunkBuffer.h
index 410532232..b1bd024d5 100644
--- a/src/ChunkBuffer.h
+++ b/src/ChunkBuffer.h
@@ -124,7 +124,7 @@ public:
m_Sections[Section] = Allocate();
if(!m_Sections[Section])
{
- ASSERT("Failed to allocate a new section in Chunkbuffer");
+ ASSERT(!"Failed to allocate a new section in Chunkbuffer");
return;
}
}
@@ -169,7 +169,7 @@ public:
m_Sections[Section] = Allocate();
if(!m_Sections[Section])
{
- ASSERT("Failed to allocate a new section in Chunkbuffer");
+ ASSERT(!"Failed to allocate a new section in Chunkbuffer");
return;
}
}