diff options
author | Mattes D <github@xoft.cz> | 2013-11-28 19:59:44 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2013-11-28 19:59:44 +0100 |
commit | 13dade5a83afec03df1101ebfbea928a59e1f420 (patch) | |
tree | 2366cc39fd0811fe3e9b5fabd129a2d1fef84edc /src/Piston.cpp | |
parent | Merge pull request #374 from mc-server/VS2013compilefix (diff) | |
parent | Fixed a bug with TNT waking simulators (diff) | |
download | cuberite-13dade5a83afec03df1101ebfbea928a59e1f420.tar cuberite-13dade5a83afec03df1101ebfbea928a59e1f420.tar.gz cuberite-13dade5a83afec03df1101ebfbea928a59e1f420.tar.bz2 cuberite-13dade5a83afec03df1101ebfbea928a59e1f420.tar.lz cuberite-13dade5a83afec03df1101ebfbea928a59e1f420.tar.xz cuberite-13dade5a83afec03df1101ebfbea928a59e1f420.tar.zst cuberite-13dade5a83afec03df1101ebfbea928a59e1f420.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Piston.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/Piston.cpp b/src/Piston.cpp index 048cc355d..63ffbad0b 100644 --- a/src/Piston.cpp +++ b/src/Piston.cpp @@ -24,7 +24,6 @@ const int PISTON_TICK_DELAY = 6; cPiston::cPiston(cWorld * a_World) : m_World(a_World) { - } @@ -132,19 +131,21 @@ void cPiston::RetractPiston(int pistx, int pisty, int pistz) // Already retracted, bail out return; } - - m_World->BroadcastBlockAction(pistx, pisty, pistz, 1, pistonMeta & ~(8), pistonBlock); - m_World->BroadcastSoundEffect("tile.piston.in", pistx * 8, pisty * 8, pistz * 8, 0.5f, 0.7f); - m_World->SetBlock(pistx, pisty, pistz, pistonBlock, pistonMeta & ~(8)); // Check the extension: AddDir(pistx, pisty, pistz, pistonMeta, 1); if (m_World->GetBlock(pistx, pisty, pistz) != E_BLOCK_PISTON_EXTENSION) { - LOGD("%s: Piston without an extension?", __FUNCTION__); + LOGD("%s: Piston without an extension - still extending, or just in an invalid state?", __FUNCTION__); return; } + AddDir(pistx, pisty, pistz, pistonMeta, -1); + m_World->BroadcastBlockAction(pistx, pisty, pistz, 1, pistonMeta & ~(8), pistonBlock); + m_World->BroadcastSoundEffect("tile.piston.in", pistx * 8, pisty * 8, pistz * 8, 0.5f, 0.7f); + m_World->SetBlock(pistx, pisty, pistz, pistonBlock, pistonMeta & ~(8)); + AddDir(pistx, pisty, pistz, pistonMeta, 1); + // Retract the extension, pull block if appropriate if (IsSticky(pistonBlock)) { |