1
0

WSSAnvil: Added clamping to entity coords.

Fixes CID 72854.
This commit is contained in:
Mattes D 2014-12-21 22:37:48 +01:00
parent e192da5316
commit f232704203

View File

@ -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;
}