summaryrefslogtreecommitdiffstats
path: root/source/Chunk.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-04-27 15:23:20 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-04-27 15:23:20 +0200
commit1b7ea2ef822a9e2cafaed5cd6c1fc16a22a2a96a (patch)
treec5ab9b421d24495c5280463c29d71dd30ee6f255 /source/Chunk.cpp
parentInitial version of "DistortedMembraneOverhangs" (diff)
downloadcuberite-1b7ea2ef822a9e2cafaed5cd6c1fc16a22a2a96a.tar
cuberite-1b7ea2ef822a9e2cafaed5cd6c1fc16a22a2a96a.tar.gz
cuberite-1b7ea2ef822a9e2cafaed5cd6c1fc16a22a2a96a.tar.bz2
cuberite-1b7ea2ef822a9e2cafaed5cd6c1fc16a22a2a96a.tar.lz
cuberite-1b7ea2ef822a9e2cafaed5cd6c1fc16a22a2a96a.tar.xz
cuberite-1b7ea2ef822a9e2cafaed5cd6c1fc16a22a2a96a.tar.zst
cuberite-1b7ea2ef822a9e2cafaed5cd6c1fc16a22a2a96a.zip
Diffstat (limited to 'source/Chunk.cpp')
-rw-r--r--source/Chunk.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/Chunk.cpp b/source/Chunk.cpp
index 802cb358c..83a07d56d 100644
--- a/source/Chunk.cpp
+++ b/source/Chunk.cpp
@@ -1043,6 +1043,12 @@ bool cChunk::UnboundedRelFastSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKT
void cChunk::UnboundedQueueTickBlock(int a_RelX, int a_RelY, int a_RelZ)
{
+ if ((a_RelY < 0) || (a_RelY >= cChunkDef::Height))
+ {
+ // Outside of chunkmap
+ return;
+ }
+
// Is it in this chunk?
if ((a_RelX >= 0) && (a_RelX < cChunkDef::Width) && (a_RelZ >= 0) && (a_RelZ < cChunkDef::Width))
{
@@ -1350,6 +1356,12 @@ void cChunk::SetBlock( int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType
void cChunk::QueueTickBlock(int a_RelX, int a_RelY, int a_RelZ)
{
+ ASSERT (
+ (a_RelX >= 0) && (a_RelX < Width) &&
+ (a_RelY >= 0) && (a_RelY < Height) &&
+ (a_RelZ >= 0) && (a_RelZ < Width)
+ ); // Coords need to be valid
+
if (!IsValid())
{
return;