diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-02-07 10:19:59 +0100 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-02-07 10:19:59 +0100 |
commit | 1ba07a82b6237188c74f937d28f383972e63c151 (patch) | |
tree | 0906d47f255f06ad5e10a12643742dcc9d971300 /source | |
parent | Added a cGZipFile class for reading GZipped files. (diff) | |
download | cuberite-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 '')
-rw-r--r-- | source/BlockArea.cpp | 13 |
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);
|