summaryrefslogtreecommitdiffstats
path: root/source/Blocks/BlockPiston.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Blocks/BlockPiston.cpp')
-rw-r--r--source/Blocks/BlockPiston.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/Blocks/BlockPiston.cpp b/source/Blocks/BlockPiston.cpp
index d5750ebdd..3e1ca1d15 100644
--- a/source/Blocks/BlockPiston.cpp
+++ b/source/Blocks/BlockPiston.cpp
@@ -93,6 +93,14 @@ void cBlockPistonHeadHandler::OnDestroyedByPlayer(cWorld * a_World, cPlayer * a_
if ((Block == E_BLOCK_STICKY_PISTON) || (Block == E_BLOCK_PISTON))
{
a_World->DigBlock(newX, newY, newZ);
+ if (a_Player->IsGameModeCreative())
+ {
+ return; // No pickups if creative
+ }
+
+ cItems Pickups;
+ Pickups.push_back(cItem(Block, 1));
+ a_World->SpawnItemPickups(Pickups, a_BlockX + 0.5, a_BlockY + 0.5, a_BlockZ + 0.5);
}
}