From 9abc3657832a4e0b52eb5bd2d4ab2baabd321506 Mon Sep 17 00:00:00 2001 From: Howaner Date: Sun, 30 Nov 2014 21:16:21 +0100 Subject: Fixed signs and added missing blocks to sand simulators list --- src/Blocks/BlockWallSign.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/Blocks/BlockWallSign.h') diff --git a/src/Blocks/BlockWallSign.h b/src/Blocks/BlockWallSign.h index 0abe9c52c..9a7d4aa58 100644 --- a/src/Blocks/BlockWallSign.h +++ b/src/Blocks/BlockWallSign.h @@ -40,12 +40,18 @@ public: virtual bool CanBeAt(cChunkInterface & a_ChunkInterface, int a_RelX, int a_RelY, int a_RelZ, const cChunk & a_Chunk) override { - int BlockX = (a_Chunk.GetPosX() * cChunkDef::Width) + a_RelX; - int BlockZ = (a_Chunk.GetPosZ() * cChunkDef::Width) + a_RelZ; - GetBlockCoordsBehindTheSign(a_Chunk.GetMeta(a_RelX, a_RelY, a_RelZ), BlockX, BlockZ); - BLOCKTYPE Type = a_ChunkInterface.GetBlock(BlockX, a_RelY, BlockZ); + if (a_Chunk.GetBlock(a_RelX, a_RelY, a_RelZ) != m_BlockType) + { + return true; + } + + NIBBLETYPE Meta = a_Chunk.GetMeta(a_RelX, a_RelY, a_RelZ); + GetBlockCoordsBehindTheSign(Meta, a_RelX, a_RelZ); + + cChunk * Chunk = a_Chunk.GetRelNeighborChunkAdjustCoords(a_RelX, a_RelZ); + BLOCKTYPE BehindBlock = Chunk->GetBlock(a_RelX, a_RelY, a_RelZ); - return ((Type == E_BLOCK_WALLSIGN) || (Type == E_BLOCK_SIGN_POST) || cBlockInfo::IsSolid(Type)); + return ((BehindBlock == E_BLOCK_WALLSIGN) || (BehindBlock == E_BLOCK_SIGN_POST) || cBlockInfo::IsSolid(BehindBlock)); } -- cgit v1.2.3