summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJulian Laubstein <julianlaubstein@yahoo.de>2015-11-23 01:26:17 +0100
committerJulian Laubstein <julianlaubstein@yahoo.de>2015-11-23 01:30:48 +0100
commit62b41c351cd7f694147d24f631881d4c9ce9c88b (patch)
treea6a2ba2e4f1de5a4bde5f742f793f57f8e37347c /src
parentMerge pull request #2676 from SafwatHalaby/revert (diff)
downloadcuberite-62b41c351cd7f694147d24f631881d4c9ce9c88b.tar
cuberite-62b41c351cd7f694147d24f631881d4c9ce9c88b.tar.gz
cuberite-62b41c351cd7f694147d24f631881d4c9ce9c88b.tar.bz2
cuberite-62b41c351cd7f694147d24f631881d4c9ce9c88b.tar.lz
cuberite-62b41c351cd7f694147d24f631881d4c9ce9c88b.tar.xz
cuberite-62b41c351cd7f694147d24f631881d4c9ce9c88b.tar.zst
cuberite-62b41c351cd7f694147d24f631881d4c9ce9c88b.zip
Diffstat (limited to 'src')
-rw-r--r--src/ChunkDef.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ChunkDef.h b/src/ChunkDef.h
index c69f1fdf3..ae4e9393b 100644
--- a/src/ChunkDef.h
+++ b/src/ChunkDef.h
@@ -120,7 +120,12 @@ public:
{
return ((a_Height >= 0) && (a_Height < Height));
}
-
+
+ /** Validates a width-coordinate. Returns false if width-coordiante is out of width bounds */
+ inline static bool IsValidWidth(int a_Width)
+ {
+ return ((a_Width >= 0) && (a_Width < Width));
+ }
/** Converts absolute block coords to chunk coords: */
inline static void BlockToChunk(int a_X, int a_Z, int & a_ChunkX, int & a_ChunkZ)