summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-09-21 18:08:05 +0200
committermadmaxoft <github@xoft.cz>2013-09-21 18:08:30 +0200
commit405d434c06bc3094ed70c2f20b3849273e1fbdd2 (patch)
tree6ecce434c94a9ce3366691e87a3871c5685f7876
parentMerge pull request #179 from tonibm19/patch-6 (diff)
downloadcuberite-405d434c06bc3094ed70c2f20b3849273e1fbdd2.tar
cuberite-405d434c06bc3094ed70c2f20b3849273e1fbdd2.tar.gz
cuberite-405d434c06bc3094ed70c2f20b3849273e1fbdd2.tar.bz2
cuberite-405d434c06bc3094ed70c2f20b3849273e1fbdd2.tar.lz
cuberite-405d434c06bc3094ed70c2f20b3849273e1fbdd2.tar.xz
cuberite-405d434c06bc3094ed70c2f20b3849273e1fbdd2.tar.zst
cuberite-405d434c06bc3094ed70c2f20b3849273e1fbdd2.zip
-rw-r--r--source/ClientHandle.cpp1
-rw-r--r--source/Items/ItemHandler.cpp2
2 files changed, 2 insertions, 1 deletions
diff --git a/source/ClientHandle.cpp b/source/ClientHandle.cpp
index 1806ce8e6..9ae6095b6 100644
--- a/source/ClientHandle.cpp
+++ b/source/ClientHandle.cpp
@@ -735,6 +735,7 @@ void cClientHandle::HandleBlockDigFinished(int a_BlockX, int a_BlockY, int a_Blo
cWorld * World = m_Player->GetWorld();
ItemHandler->OnBlockDestroyed(World, m_Player, m_Player->GetEquippedItem(), a_BlockX, a_BlockY, a_BlockZ);
+ // The ItemHandler is also responsible for spawning the pickups
BlockHandler(a_OldBlock)->OnDestroyedByPlayer(World, m_Player, a_BlockX, a_BlockY, a_BlockZ);
World->BroadcastSoundParticleEffect(2001, a_BlockX * 8, a_BlockY * 8, a_BlockZ * 8, a_OldBlock, this);
diff --git a/source/Items/ItemHandler.cpp b/source/Items/ItemHandler.cpp
index 9d38e6f3a..13f5293b9 100644
--- a/source/Items/ItemHandler.cpp
+++ b/source/Items/ItemHandler.cpp
@@ -247,7 +247,7 @@ void cItemHandler::OnBlockDestroyed(cWorld * a_World, cPlayer * a_Player, const
BLOCKTYPE Block = a_World->GetBlock(a_BlockX, a_BlockY, a_BlockZ);
cBlockHandler * Handler = cBlockHandler::GetBlockHandler(Block);
- if (a_Player->GetGameMode() == gmSurvival)
+ if (a_Player->IsGameModeSurvival())
{
if (!BlockRequiresSpecialTool(Block) || CanHarvestBlock(Block))
{