summaryrefslogtreecommitdiffstats
path: root/src/Simulator/IncrementalRedstoneSimulator.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-06-09 21:20:26 +0200
committermadmaxoft <github@xoft.cz>2014-06-09 21:20:26 +0200
commitdcc71a3b7b08eec0d2965e495a49d0a03b9a8257 (patch)
tree258a4afa5a8ec6648915a2e9378ef402532f43ce /src/Simulator/IncrementalRedstoneSimulator.cpp
parentdocs/Generator: Fixed typo. (diff)
parentMoved the IsDoor check before the meta get. (diff)
downloadcuberite-dcc71a3b7b08eec0d2965e495a49d0a03b9a8257.tar
cuberite-dcc71a3b7b08eec0d2965e495a49d0a03b9a8257.tar.gz
cuberite-dcc71a3b7b08eec0d2965e495a49d0a03b9a8257.tar.bz2
cuberite-dcc71a3b7b08eec0d2965e495a49d0a03b9a8257.tar.lz
cuberite-dcc71a3b7b08eec0d2965e495a49d0a03b9a8257.tar.xz
cuberite-dcc71a3b7b08eec0d2965e495a49d0a03b9a8257.tar.zst
cuberite-dcc71a3b7b08eec0d2965e495a49d0a03b9a8257.zip
Diffstat (limited to 'src/Simulator/IncrementalRedstoneSimulator.cpp')
-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 aef332e9f..b32a57165 100644
--- a/src/Simulator/IncrementalRedstoneSimulator.cpp
+++ b/src/Simulator/IncrementalRedstoneSimulator.cpp
@@ -965,8 +965,11 @@ void cIncrementalRedstoneSimulator::HandleDoor(int a_RelBlockX, int a_RelBlockY,
if (!AreCoordsSimulated(a_RelBlockX, a_RelBlockY, a_RelBlockZ, true))
{
cChunkInterface ChunkInterface(m_World.GetChunkMap());
- cBlockDoorHandler::ChangeDoor(ChunkInterface, a_RelBlockX, a_RelBlockY, a_RelBlockZ);
- m_Chunk->BroadcastSoundParticleEffect(1003, BlockX, a_RelBlockY, BlockZ, 0);
+ if (!cBlockDoorHandler::IsOpen(ChunkInterface, BlockX, a_RelBlockY, BlockZ))
+ {
+ cBlockDoorHandler::SetOpen(ChunkInterface, BlockX, a_RelBlockY, BlockZ, true);
+ m_Chunk->BroadcastSoundParticleEffect(1003, BlockX, a_RelBlockY, BlockZ, 0);
+ }
SetPlayerToggleableBlockAsSimulated(a_RelBlockX, a_RelBlockY, a_RelBlockZ, true);
}
}
@@ -975,8 +978,11 @@ void cIncrementalRedstoneSimulator::HandleDoor(int a_RelBlockX, int a_RelBlockY,
if (!AreCoordsSimulated(a_RelBlockX, a_RelBlockY, a_RelBlockZ, false))
{
cChunkInterface ChunkInterface(m_World.GetChunkMap());
- cBlockDoorHandler::ChangeDoor(ChunkInterface, a_RelBlockX, a_RelBlockY, a_RelBlockZ);
- m_Chunk->BroadcastSoundParticleEffect(1003, BlockX, a_RelBlockY, BlockZ, 0);
+ if (cBlockDoorHandler::IsOpen(ChunkInterface, BlockX, a_RelBlockY, BlockZ))
+ {
+ cBlockDoorHandler::SetOpen(ChunkInterface, BlockX, a_RelBlockY, BlockZ, false);
+ m_Chunk->BroadcastSoundParticleEffect(1003, BlockX, a_RelBlockY, BlockZ, 0);
+ }
SetPlayerToggleableBlockAsSimulated(a_RelBlockX, a_RelBlockY, a_RelBlockZ, false);
}
}