From fb7c60ec11fde185d30ae6cc59e8c85756f85b8f Mon Sep 17 00:00:00 2001 From: faketruth Date: Sun, 4 Mar 2012 13:54:33 +0000 Subject: Changed signed char to unsigned char in block packets, so we can receive height up to 255 Blocks placed above 128 limit don't become obsidian anymore. This was due to the cChunk::MakeIndex() function return 0 when outside of bounds, it now returns an 'error constant' git-svn-id: http://mc-server.googlecode.com/svn/trunk@356 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cChunk.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/cChunk.h') diff --git a/source/cChunk.h b/source/cChunk.h index cbf3b3b85..0759b79f0 100644 --- a/source/cChunk.h +++ b/source/cChunk.h @@ -214,13 +214,14 @@ public: void PositionToWorldPosition(int a_ChunkX, int a_ChunkY, int a_ChunkZ, int & a_X, int & a_Y, int & a_Z); Vector3i PositionToWorldPosition( const Vector3i & a_InChunkPos ); + static const unsigned int INDEX_OUT_OF_RANGE = 0xffffffff; inline static unsigned int MakeIndex(int x, int y, int z ) { if( x < c_ChunkWidth && x > -1 && y < c_ChunkHeight && y > -1 && z < c_ChunkWidth && z > -1 ) { return y + (z * c_ChunkHeight) + (x * c_ChunkHeight * c_ChunkWidth); } - return 0; + return INDEX_OUT_OF_RANGE; } inline void MarkDirty(void) -- cgit v1.2.3