From d006ea533763c19d0c35877e87c1384bdd65630d Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sat, 20 Oct 2012 11:40:34 +0000 Subject: Made cWorld's block query functions more orthogonal, added GetBlockInfo() returning all info on a block. git-svn-id: http://mc-server.googlecode.com/svn/trunk@986 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/ChunkDef.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source/ChunkDef.h') diff --git a/source/ChunkDef.h b/source/ChunkDef.h index db3bf4740..0eebabefe 100644 --- a/source/ChunkDef.h +++ b/source/ChunkDef.h @@ -218,6 +218,13 @@ public: } + inline static BLOCKTYPE GetBlock(const BLOCKTYPE * a_BlockTypes, int a_Idx) + { + ASSERT((a_Idx >= 0) && (a_Idx < Width * Width * Height)); + return a_BlockTypes[a_Idx]; + } + + inline static int GetHeight(const HeightMap & a_HeightMap, int a_X, int a_Z) { return a_HeightMap[a_X + Width * a_Z]; -- cgit v1.2.3