1
0

Added cChunkDef::IsValidHeight()

This commit is contained in:
Julian Laubstein 2015-11-10 16:11:47 +01:00
parent ef1b82a33d
commit 98bac62c07

View File

@ -115,6 +115,12 @@ public:
return Vector3i(a_RelBlockPosition.x + a_ChunkX * Width, a_RelBlockPosition.y, a_RelBlockPosition.z + a_ChunkZ * Width);
}
/** Validates a height-coordinate. Returns false if height-coordiante is out of height bounds */
inline static bool IsValidHeight(int a_Height)
{
return ((a_Height >= 0) && (a_Height < Height));
}
/** Converts absolute block coords to chunk coords: */
inline static void BlockToChunk(int a_X, int a_Z, int & a_ChunkX, int & a_ChunkZ)