summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-12-21 22:37:48 +0100
committerMattes D <github@xoft.cz>2014-12-21 22:37:48 +0100
commitf2327042037383abc2773710dac78af527bc5500 (patch)
tree09f02326e334f4874866cc47f531fe66d5a4b385
parentFastNBT: Added a sanity check for number of list items. (diff)
downloadcuberite-f2327042037383abc2773710dac78af527bc5500.tar
cuberite-f2327042037383abc2773710dac78af527bc5500.tar.gz
cuberite-f2327042037383abc2773710dac78af527bc5500.tar.bz2
cuberite-f2327042037383abc2773710dac78af527bc5500.tar.lz
cuberite-f2327042037383abc2773710dac78af527bc5500.tar.xz
cuberite-f2327042037383abc2773710dac78af527bc5500.tar.zst
cuberite-f2327042037383abc2773710dac78af527bc5500.zip
Diffstat (limited to '')
-rwxr-xr-xsrc/WorldStorage/WSSAnvil.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/WorldStorage/WSSAnvil.cpp b/src/WorldStorage/WSSAnvil.cpp
index cf51ab19c..a76e9461a 100755
--- a/src/WorldStorage/WSSAnvil.cpp
+++ b/src/WorldStorage/WSSAnvil.cpp
@@ -2945,9 +2945,9 @@ bool cWSSAnvil::GetBlockEntityNBTPos(const cParsedNBT & a_NBT, int a_TagIdx, int
{
return false;
}
- a_X = a_NBT.GetInt(x);
- a_Y = a_NBT.GetInt(y);
- a_Z = a_NBT.GetInt(z);
+ a_X = Clamp(a_NBT.GetInt(x), -40000000, 40000000); // World is limited to 30M blocks in XZ, we clamp to 40M
+ a_Y = Clamp(a_NBT.GetInt(y), -10000, 10000); // Y is limited to 0 .. 255, we clamp to 10K
+ a_Z = Clamp(a_NBT.GetInt(z), -40000000, 40000000);
return true;
}