summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-02-07 10:19:59 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-02-07 10:19:59 +0100
commit1ba07a82b6237188c74f937d28f383972e63c151 (patch)
tree0906d47f255f06ad5e10a12643742dcc9d971300 /source
parentAdded a cGZipFile class for reading GZipped files. (diff)
downloadcuberite-1ba07a82b6237188c74f937d28f383972e63c151.tar
cuberite-1ba07a82b6237188c74f937d28f383972e63c151.tar.gz
cuberite-1ba07a82b6237188c74f937d28f383972e63c151.tar.bz2
cuberite-1ba07a82b6237188c74f937d28f383972e63c151.tar.lz
cuberite-1ba07a82b6237188c74f937d28f383972e63c151.tar.xz
cuberite-1ba07a82b6237188c74f937d28f383972e63c151.tar.zst
cuberite-1ba07a82b6237188c74f937d28f383972e63c151.zip
Diffstat (limited to 'source')
-rw-r--r--source/BlockArea.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/BlockArea.cpp b/source/BlockArea.cpp
index 6a973efe6..5cc78fd88 100644
--- a/source/BlockArea.cpp
+++ b/source/BlockArea.cpp
@@ -225,6 +225,19 @@ bool cBlockArea::LoadFromSchematicFile(const AString & a_FileName)
void cBlockArea::Crop(int a_AddMinX, int a_SubMaxX, int a_AddMinY, int a_SubMaxY, int a_AddMinZ, int a_SubMaxZ)
{
+ if (
+ (a_AddMinX + a_SubMaxX >= m_SizeX) ||
+ (a_AddMinY + a_SubMaxY >= m_SizeY) ||
+ (a_AddMinZ + a_SubMaxZ >= m_SizeZ)
+ )
+ {
+ LOGWARNING("cBlockArea:Crop called with more croping than the dimensions: %d x %d x %d with cropping %d, %d and %d",
+ m_SizeX, m_SizeY, m_SizeZ,
+ a_AddMinX + a_SubMaxX, a_AddMinY + a_SubMaxY, a_AddMinZ + a_SubMaxZ
+ );
+ return;
+ }
+
if (HasBlockTypes())
{
CropBlockTypes(a_AddMinX, a_SubMaxX, a_AddMinY, a_SubMaxY, a_AddMinZ, a_SubMaxZ);