From 62b41c351cd7f694147d24f631881d4c9ce9c88b Mon Sep 17 00:00:00 2001 From: Julian Laubstein Date: Mon, 23 Nov 2015 01:26:17 +0100 Subject: Added cChunkDef::IsValidWidth() --- src/ChunkDef.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3