summaryrefslogtreecommitdiffstats
path: root/src/ChunkDef.h
diff options
context:
space:
mode:
authorJulian Laubstein <julianlaubstein@yahoo.de>2015-11-10 16:11:47 +0100
committerJulian Laubstein <julianlaubstein@yahoo.de>2015-11-10 19:44:30 +0100
commit98bac62c0749786138b299d08e2c31db7d46421a (patch)
tree4a10e0dbcb21ade64d43592802c568655816935f /src/ChunkDef.h
parentMerge pull request #2631 from Gargaj/divby0 (diff)
downloadcuberite-98bac62c0749786138b299d08e2c31db7d46421a.tar
cuberite-98bac62c0749786138b299d08e2c31db7d46421a.tar.gz
cuberite-98bac62c0749786138b299d08e2c31db7d46421a.tar.bz2
cuberite-98bac62c0749786138b299d08e2c31db7d46421a.tar.lz
cuberite-98bac62c0749786138b299d08e2c31db7d46421a.tar.xz
cuberite-98bac62c0749786138b299d08e2c31db7d46421a.tar.zst
cuberite-98bac62c0749786138b299d08e2c31db7d46421a.zip
Diffstat (limited to '')
-rw-r--r--src/ChunkDef.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ChunkDef.h b/src/ChunkDef.h
index fcda9b5a6..c69f1fdf3 100644
--- a/src/ChunkDef.h
+++ b/src/ChunkDef.h
@@ -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)