summaryrefslogtreecommitdiffstats
path: root/src/Simulator
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-06-22 20:56:24 +0200
committerMattes D <github@xoft.cz>2014-06-22 20:56:24 +0200
commitfe95dfa7588dc7173bea0b6c38e9b11243ccf792 (patch)
tree4e46a3cd5351e53bc6b8d491ec99fdf8fb6fa1f8 /src/Simulator
parentMerge branch 'master' of https://github.com/mc-server/MCServer (diff)
parentChanged 0xFFFFFFFB to ~0x04 (diff)
downloadcuberite-fe95dfa7588dc7173bea0b6c38e9b11243ccf792.tar
cuberite-fe95dfa7588dc7173bea0b6c38e9b11243ccf792.tar.gz
cuberite-fe95dfa7588dc7173bea0b6c38e9b11243ccf792.tar.bz2
cuberite-fe95dfa7588dc7173bea0b6c38e9b11243ccf792.tar.lz
cuberite-fe95dfa7588dc7173bea0b6c38e9b11243ccf792.tar.xz
cuberite-fe95dfa7588dc7173bea0b6c38e9b11243ccf792.tar.zst
cuberite-fe95dfa7588dc7173bea0b6c38e9b11243ccf792.zip
Diffstat (limited to 'src/Simulator')
-rw-r--r--src/Simulator/IncrementalRedstoneSimulator.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/Simulator/IncrementalRedstoneSimulator.cpp b/src/Simulator/IncrementalRedstoneSimulator.cpp
index 1de0d2c34..10446a879 100644
--- a/src/Simulator/IncrementalRedstoneSimulator.cpp
+++ b/src/Simulator/IncrementalRedstoneSimulator.cpp
@@ -526,8 +526,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);
}
}
@@ -535,8 +538,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 & ~0x04);
+ m_Chunk->BroadcastSoundParticleEffect(1003, BlockX, a_RelBlockY, BlockZ, 0);
+ }
SetPlayerToggleableBlockAsSimulated(a_RelBlockX, a_RelBlockY, a_RelBlockZ, false);
}
}