summaryrefslogtreecommitdiffstats
path: root/source/ClientHandle.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-05-24 09:30:39 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-05-24 09:30:39 +0200
commitcf87169737fdeeee7d4b160688bbed7194e46147 (patch)
tree7daaeb9af8e3187cde6068c3cff5ff0ee64f0067 /source/ClientHandle.cpp
parentAdded ItemCategory::IsArmor() (diff)
downloadcuberite-cf87169737fdeeee7d4b160688bbed7194e46147.tar
cuberite-cf87169737fdeeee7d4b160688bbed7194e46147.tar.gz
cuberite-cf87169737fdeeee7d4b160688bbed7194e46147.tar.bz2
cuberite-cf87169737fdeeee7d4b160688bbed7194e46147.tar.lz
cuberite-cf87169737fdeeee7d4b160688bbed7194e46147.tar.xz
cuberite-cf87169737fdeeee7d4b160688bbed7194e46147.tar.zst
cuberite-cf87169737fdeeee7d4b160688bbed7194e46147.zip
Diffstat (limited to 'source/ClientHandle.cpp')
-rw-r--r--source/ClientHandle.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/source/ClientHandle.cpp b/source/ClientHandle.cpp
index 1ea94c8c2..6fe874bc4 100644
--- a/source/ClientHandle.cpp
+++ b/source/ClientHandle.cpp
@@ -791,7 +791,7 @@ void cClientHandle::HandleRightClick(int a_BlockX, int a_BlockY, int a_BlockZ, c
if (ItemHandler->EatItem(m_Player, &Item))
{
ItemHandler->OnFoodEaten(World, m_Player, &Item);
- m_Player->GetInventory().RemoveItem(Item);
+ m_Player->GetInventory().RemoveOneEquippedItem();
return;
}
}
@@ -877,10 +877,9 @@ void cClientHandle::HandlePlaceBlock(int a_BlockX, int a_BlockY, int a_BlockZ, c
// The actual block placement:
World->SetBlock(a_BlockX, a_BlockY, a_BlockZ, BlockType, BlockMeta);
- if (m_Player->GetGameMode() == eGameMode_Survival)
+ if (m_Player->GetGameMode() != gmCreative)
{
- cItem Item(m_Player->GetEquippedItem().m_ItemType, 1);
- m_Player->GetInventory().RemoveItem(Item);
+ m_Player->GetInventory().RemoveOneEquippedItem();
}
NewBlock->OnPlacedByPlayer(World, m_Player, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_CursorX, a_CursorY, a_CursorZ, BlockType, BlockMeta);