summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-09-25 21:23:05 +0200
committermadmaxoft <github@xoft.cz>2014-09-25 21:23:05 +0200
commit0443f5d531b21917b3605254b17475569573fc48 (patch)
tree5258107f8a5b2a8733af2f53f1ee531d2626840e
parentTwoLevel BioGen: reads params from INI file. (diff)
downloadcuberite-0443f5d531b21917b3605254b17475569573fc48.tar
cuberite-0443f5d531b21917b3605254b17475569573fc48.tar.gz
cuberite-0443f5d531b21917b3605254b17475569573fc48.tar.bz2
cuberite-0443f5d531b21917b3605254b17475569573fc48.tar.lz
cuberite-0443f5d531b21917b3605254b17475569573fc48.tar.xz
cuberite-0443f5d531b21917b3605254b17475569573fc48.tar.zst
cuberite-0443f5d531b21917b3605254b17475569573fc48.zip
Diffstat (limited to '')
-rw-r--r--src/ByteBuffer.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ByteBuffer.cpp b/src/ByteBuffer.cpp
index 5bf98eda9..e61a90bbc 100644
--- a/src/ByteBuffer.cpp
+++ b/src/ByteBuffer.cpp
@@ -500,9 +500,9 @@ bool cByteBuffer::ReadPosition(int & a_BlockX, int & a_BlockY, int & a_BlockZ)
UInt32 BlockXRaw = (Value >> 38) & 0x3ffffff;
UInt32 BlockYRaw = (Value >> 26) & 0xfff;
UInt32 BlockZRaw = (Value & 0x3ffffff);
- a_BlockX = ((BlockXRaw & 0x2000000) == 0) ? BlockXRaw : (~(BlockXRaw & 0x1ffffff)) + 1;
- a_BlockY = ((BlockYRaw & 0x800) == 0) ? BlockYRaw : (~(BlockXRaw & 0x7ff)) + 1;
- a_BlockZ = ((BlockZRaw & 0x2000000) == 0) ? BlockZRaw : (~(BlockZRaw & 0x1ffffff)) + 1;
+ a_BlockX = ((BlockXRaw & 0x2000000) == 0) ? BlockXRaw : -(0x03ffffff - (int)BlockXRaw + 1);
+ a_BlockY = ((BlockYRaw & 0x800) == 0) ? BlockYRaw : -(0x07ff - (int)BlockYRaw + 1);
+ a_BlockZ = ((BlockZRaw & 0x2000000) == 0) ? BlockZRaw : -(0x03ffffff - (int)BlockZRaw + 1);
return true;
}