summaryrefslogtreecommitdiffstats
path: root/source/Blocks/BlockPiston.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2013-11-22 22:57:06 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2013-11-22 22:57:06 +0100
commitc7d55d8bbdcf08bd8f5a4b613f8931f63bc90470 (patch)
tree8dec8ccf925a0f9067b0f3bf394b4f971dfcf982 /source/Blocks/BlockPiston.cpp
parentMultiple enhancements [SEE DESC] (diff)
downloadcuberite-c7d55d8bbdcf08bd8f5a4b613f8931f63bc90470.tar
cuberite-c7d55d8bbdcf08bd8f5a4b613f8931f63bc90470.tar.gz
cuberite-c7d55d8bbdcf08bd8f5a4b613f8931f63bc90470.tar.bz2
cuberite-c7d55d8bbdcf08bd8f5a4b613f8931f63bc90470.tar.lz
cuberite-c7d55d8bbdcf08bd8f5a4b613f8931f63bc90470.tar.xz
cuberite-c7d55d8bbdcf08bd8f5a4b613f8931f63bc90470.tar.zst
cuberite-c7d55d8bbdcf08bd8f5a4b613f8931f63bc90470.zip
Diffstat (limited to 'source/Blocks/BlockPiston.cpp')
-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);
}
}