diff options
author | Mattes D <github@xoft.cz> | 2014-09-26 22:24:45 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-09-26 22:24:45 +0200 |
commit | 2c5b0f23788f027ebcb6e38d26036a04d011e1fd (patch) | |
tree | 0fde79c6cc466306eb042e88728c209cbc94f789 /src/Items/ItemDoor.h | |
parent | Merge pull request #1455 from mc-server/includes (diff) | |
parent | Moved curly brace to seperate line (diff) | |
download | cuberite-2c5b0f23788f027ebcb6e38d26036a04d011e1fd.tar cuberite-2c5b0f23788f027ebcb6e38d26036a04d011e1fd.tar.gz cuberite-2c5b0f23788f027ebcb6e38d26036a04d011e1fd.tar.bz2 cuberite-2c5b0f23788f027ebcb6e38d26036a04d011e1fd.tar.lz cuberite-2c5b0f23788f027ebcb6e38d26036a04d011e1fd.tar.xz cuberite-2c5b0f23788f027ebcb6e38d26036a04d011e1fd.tar.zst cuberite-2c5b0f23788f027ebcb6e38d26036a04d011e1fd.zip |
Diffstat (limited to 'src/Items/ItemDoor.h')
-rw-r--r-- | src/Items/ItemDoor.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/Items/ItemDoor.h b/src/Items/ItemDoor.h index c1b439024..cd5baf44f 100644 --- a/src/Items/ItemDoor.h +++ b/src/Items/ItemDoor.h @@ -30,7 +30,22 @@ public: BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta ) override { - a_BlockType = (m_ItemType == E_ITEM_WOODEN_DOOR) ? E_BLOCK_WOODEN_DOOR : E_BLOCK_IRON_DOOR; + switch (m_ItemType) + { + case E_ITEM_WOODEN_DOOR: a_BlockType = E_BLOCK_WOODEN_DOOR; break; + case E_ITEM_IRON_DOOR: a_BlockType = E_BLOCK_IRON_DOOR; break; + case E_ITEM_SPRUCE_DOOR: a_BlockType = E_BLOCK_SPRUCE_DOOR; break; + case E_ITEM_BIRCH_DOOR: a_BlockType = E_BLOCK_BIRCH_DOOR; break; + case E_ITEM_JUNGLE_DOOR: a_BlockType = E_BLOCK_JUNGLE_DOOR; break; + case E_ITEM_DARK_OAK_DOOR: a_BlockType = E_BLOCK_DARK_OAK_DOOR; break; + case E_ITEM_ACACIA_DOOR: a_BlockType = E_BLOCK_ACACIA_DOOR; break; + default: + { + ASSERT(!"Unhandled door type"); + return false; + } + } + cChunkInterface ChunkInterface(a_World->GetChunkMap()); bool Meta = BlockHandler(a_BlockType)->GetPlacementBlockTypeMeta( ChunkInterface, a_Player, |