diff options
author | worktycho <work.tycho@gmail.com> | 2015-05-21 08:50:30 +0200 |
---|---|---|
committer | worktycho <work.tycho@gmail.com> | 2015-05-21 08:50:30 +0200 |
commit | c0d7b4d56988603bafccf63df065d0cd8b336afa (patch) | |
tree | 2932be33d80782c9f570e7d7b7987bd7eb6cc65f /src | |
parent | Merge pull request #2084 from mc-server/patch-2050 (diff) | |
parent | Added beeduck to contributors (diff) | |
download | cuberite-c0d7b4d56988603bafccf63df065d0cd8b336afa.tar cuberite-c0d7b4d56988603bafccf63df065d0cd8b336afa.tar.gz cuberite-c0d7b4d56988603bafccf63df065d0cd8b336afa.tar.bz2 cuberite-c0d7b4d56988603bafccf63df065d0cd8b336afa.tar.lz cuberite-c0d7b4d56988603bafccf63df065d0cd8b336afa.tar.xz cuberite-c0d7b4d56988603bafccf63df065d0cd8b336afa.tar.zst cuberite-c0d7b4d56988603bafccf63df065d0cd8b336afa.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Blocks/BlockDoor.cpp | 20 | ||||
-rw-r--r-- | src/World.cpp | 1 |
2 files changed, 18 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; + } } } diff --git a/src/World.cpp b/src/World.cpp index e93d6bb26..7f0e3070a 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -362,6 +362,7 @@ cWorld::~cWorld() void cWorld::CastThunderbolt (int a_BlockX, int a_BlockY, int a_BlockZ) { BroadcastThunderbolt(a_BlockX, a_BlockY, a_BlockZ); + BroadcastSoundEffect("ambient.weather.thunder", a_BlockX, a_BlockY, a_BlockZ, 50, 1); } |