summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--source/Blocks/BlockPiston.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/Blocks/BlockPiston.cpp b/source/Blocks/BlockPiston.cpp
index d5750ebdd..42d7e8d35 100644
--- a/source/Blocks/BlockPiston.cpp
+++ b/source/Blocks/BlockPiston.cpp
@@ -93,6 +93,11 @@ 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);
}
}