summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockPiston.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Blocks/BlockPiston.cpp')
-rw-r--r--src/Blocks/BlockPiston.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Blocks/BlockPiston.cpp b/src/Blocks/BlockPiston.cpp
index 5a18cffac..8c6940454 100644
--- a/src/Blocks/BlockPiston.cpp
+++ b/src/Blocks/BlockPiston.cpp
@@ -297,9 +297,10 @@ void cBlockPistonHandler::RetractPiston(Vector3i a_BlockPos, cWorld & a_World)
return;
}
- // Remove extension, update base state
- World.SetBlock(extensionPos.x, extensionPos.y, extensionPos.z, E_BLOCK_AIR, 0);
- World.SetBlock(a_BlockPos.x, a_BlockPos.y, a_BlockPos.z, pistonBlock, pistonMeta & ~(8));
+ // Remove extension, update base state. Calling FastSetBlock inhibits OnBroken being called by SetBlock.
+ World.FastSetBlock(extensionPos, E_BLOCK_AIR, 0);
+ World.SetBlock(extensionPos, E_BLOCK_AIR, 0);
+ World.SetBlock(a_BlockPos, pistonBlock, pistonMeta & ~(8));
// (Retraction is always successful, but play in the task for consistency)
World.BroadcastSoundEffect("block.piston.contract", a_BlockPos, 0.5f, 0.7f);