diff options
author | faketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-03-04 14:54:33 +0100 |
---|---|---|
committer | faketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-03-04 14:54:33 +0100 |
commit | fb7c60ec11fde185d30ae6cc59e8c85756f85b8f (patch) | |
tree | 842851c4f6561782c663144dd2f5bed8a441b511 /source/cChunk.h | |
parent | Got rid of some hardcoded numbers, now using hardcoded variables! woo (diff) | |
download | cuberite-fb7c60ec11fde185d30ae6cc59e8c85756f85b8f.tar cuberite-fb7c60ec11fde185d30ae6cc59e8c85756f85b8f.tar.gz cuberite-fb7c60ec11fde185d30ae6cc59e8c85756f85b8f.tar.bz2 cuberite-fb7c60ec11fde185d30ae6cc59e8c85756f85b8f.tar.lz cuberite-fb7c60ec11fde185d30ae6cc59e8c85756f85b8f.tar.xz cuberite-fb7c60ec11fde185d30ae6cc59e8c85756f85b8f.tar.zst cuberite-fb7c60ec11fde185d30ae6cc59e8c85756f85b8f.zip |
Diffstat (limited to 'source/cChunk.h')
-rw-r--r-- | source/cChunk.h | 3 |
1 files changed, 2 insertions, 1 deletions
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)
|