diff options
author | Howaner <franzi.moos@googlemail.com> | 2014-06-17 19:47:32 +0200 |
---|---|---|
committer | Howaner <franzi.moos@googlemail.com> | 2014-06-17 19:47:32 +0200 |
commit | bcf798f260d55b6c8ce8e71ed619048c3e595877 (patch) | |
tree | 6bd69cbae33da8cc8f9e994627e7e1d9a59c86cb | |
parent | Add fence gate sound. (diff) | |
download | cuberite-bcf798f260d55b6c8ce8e71ed619048c3e595877.tar cuberite-bcf798f260d55b6c8ce8e71ed619048c3e595877.tar.gz cuberite-bcf798f260d55b6c8ce8e71ed619048c3e595877.tar.bz2 cuberite-bcf798f260d55b6c8ce8e71ed619048c3e595877.tar.lz cuberite-bcf798f260d55b6c8ce8e71ed619048c3e595877.tar.xz cuberite-bcf798f260d55b6c8ce8e71ed619048c3e595877.tar.zst cuberite-bcf798f260d55b6c8ce8e71ed619048c3e595877.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Simulator/IncrementalRedstoneSimulator.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/Simulator/IncrementalRedstoneSimulator.cpp b/src/Simulator/IncrementalRedstoneSimulator.cpp index 69c8b9f56..542bff8ad 100644 --- a/src/Simulator/IncrementalRedstoneSimulator.cpp +++ b/src/Simulator/IncrementalRedstoneSimulator.cpp @@ -553,8 +553,11 @@ void cIncrementalRedstoneSimulator::HandleFenceGate(int a_RelBlockX, int a_RelBl { if (!AreCoordsSimulated(a_RelBlockX, a_RelBlockY, a_RelBlockZ, true)) { - m_Chunk->SetMeta(a_RelBlockX, a_RelBlockY, a_RelBlockZ, MetaData | 0x4); - m_Chunk->BroadcastSoundParticleEffect(1003, BlockX, a_RelBlockY, BlockZ, 0); + if ((MetaData & 0x4) == 0) + { + m_Chunk->SetMeta(a_RelBlockX, a_RelBlockY, a_RelBlockZ, MetaData | 0x4); + m_Chunk->BroadcastSoundParticleEffect(1003, BlockX, a_RelBlockY, BlockZ, 0); + } SetPlayerToggleableBlockAsSimulated(a_RelBlockX, a_RelBlockY, a_RelBlockZ, true); } } @@ -562,8 +565,11 @@ void cIncrementalRedstoneSimulator::HandleFenceGate(int a_RelBlockX, int a_RelBl { if (!AreCoordsSimulated(a_RelBlockX, a_RelBlockY, a_RelBlockZ, false)) { - m_Chunk->SetMeta(a_RelBlockX, a_RelBlockY, a_RelBlockZ, MetaData & 0xFFFFFFFB); - m_Chunk->BroadcastSoundParticleEffect(1003, BlockX, a_RelBlockY, BlockZ, 0); + if ((MetaData & 0x4) != 0) + { + m_Chunk->SetMeta(a_RelBlockX, a_RelBlockY, a_RelBlockZ, MetaData & 0xFFFFFFFB); + m_Chunk->BroadcastSoundParticleEffect(1003, BlockX, a_RelBlockY, BlockZ, 0); + } SetPlayerToggleableBlockAsSimulated(a_RelBlockX, a_RelBlockY, a_RelBlockZ, false); } } |