diff options
author | b33duck <b33duck@gmail.com> | 2015-05-16 05:52:08 +0200 |
---|---|---|
committer | b33duck <b33duck@gmail.com> | 2015-05-21 01:24:16 +0200 |
commit | ed3c0b771f780c45e6ff24188cfd3c6c4bbfd8fd (patch) | |
tree | 6e990ca7c8d30a7061fab86849c8c880aefcf818 | |
parent | Added thunder sound effect to CastThunderbolt() (diff) | |
download | cuberite-ed3c0b771f780c45e6ff24188cfd3c6c4bbfd8fd.tar cuberite-ed3c0b771f780c45e6ff24188cfd3c6c4bbfd8fd.tar.gz cuberite-ed3c0b771f780c45e6ff24188cfd3c6c4bbfd8fd.tar.bz2 cuberite-ed3c0b771f780c45e6ff24188cfd3c6c4bbfd8fd.tar.lz cuberite-ed3c0b771f780c45e6ff24188cfd3c6c4bbfd8fd.tar.xz cuberite-ed3c0b771f780c45e6ff24188cfd3c6c4bbfd8fd.tar.zst cuberite-ed3c0b771f780c45e6ff24188cfd3c6c4bbfd8fd.zip |
-rw-r--r-- | src/Blocks/BlockDoor.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/Blocks/BlockDoor.cpp b/src/Blocks/BlockDoor.cpp index d13c8d657..a4e375cf0 100644 --- a/src/Blocks/BlockDoor.cpp +++ b/src/Blocks/BlockDoor.cpp @@ -50,10 +50,24 @@ void cBlockDoorHandler::OnUse(cChunkInterface & a_ChunkInterface, cWorldInterfac UNUSED(a_CursorY); UNUSED(a_CursorZ); - if (a_ChunkInterface.GetBlock(a_BlockX, a_BlockY, a_BlockZ) == E_BLOCK_WOODEN_DOOR) + switch (a_ChunkInterface.GetBlock(a_BlockX, a_BlockY, a_BlockZ)) { - ChangeDoor(a_ChunkInterface, a_BlockX, a_BlockY, a_BlockZ); - a_Player->GetWorld()->BroadcastSoundParticleEffect(1003, a_BlockX, a_BlockY, a_BlockZ, 0, a_Player->GetClientHandle()); + default: + { + ASSERT(!"Unhandled door block type"); + } + case E_BLOCK_ACACIA_DOOR: + case E_BLOCK_BIRCH_DOOR: + case E_BLOCK_DARK_OAK_DOOR: + case E_BLOCK_JUNGLE_DOOR: + case E_BLOCK_SPRUCE_DOOR: + case E_BLOCK_IRON_DOOR: + case E_BLOCK_WOODEN_DOOR: + { + ChangeDoor(a_ChunkInterface, a_BlockX, a_BlockY, a_BlockZ); + a_Player->GetWorld()->BroadcastSoundParticleEffect(1003, a_BlockX, a_BlockY, a_BlockZ, 0, a_Player->GetClientHandle()); + break; + } } } |