diff options
author | archshift <admin@archshift.com> | 2014-06-09 02:06:15 +0200 |
---|---|---|
committer | archshift <admin@archshift.com> | 2014-06-17 20:39:20 +0200 |
commit | 3766ac96d77329c679d01d1ab1a846384acab42f (patch) | |
tree | 0c60ce53163377434dd7de63f1f456ba2475743b /src/ClientHandle.cpp | |
parent | Splash potion: Adjusted speed, fixed spawn position (diff) | |
download | cuberite-3766ac96d77329c679d01d1ab1a846384acab42f.tar cuberite-3766ac96d77329c679d01d1ab1a846384acab42f.tar.gz cuberite-3766ac96d77329c679d01d1ab1a846384acab42f.tar.bz2 cuberite-3766ac96d77329c679d01d1ab1a846384acab42f.tar.lz cuberite-3766ac96d77329c679d01d1ab1a846384acab42f.tar.xz cuberite-3766ac96d77329c679d01d1ab1a846384acab42f.tar.zst cuberite-3766ac96d77329c679d01d1ab1a846384acab42f.zip |
Diffstat (limited to '')
-rw-r--r-- | src/ClientHandle.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index ab36bff91..9443cf2c9 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -850,7 +850,7 @@ void cClientHandle::HandleLeftClick(int a_BlockX, int a_BlockY, int a_BlockZ, eB case DIG_STATUS_SHOOT_EAT: { cItemHandler * ItemHandler = cItemHandler::GetItemHandler(m_Player->GetEquippedItem()); - if (ItemHandler->IsFood() || ItemHandler->IsDrinkable(&m_Player->GetEquippedItem())) + if (ItemHandler->IsFood() || ItemHandler->IsDrinkable(m_Player->GetEquippedItem().m_ItemDamage)) { m_Player->AbortEating(); return; @@ -1176,15 +1176,16 @@ void cClientHandle::HandleRightClick(int a_BlockX, int a_BlockY, int a_BlockZ, e return; } + short EquippedDamage = Equipped.m_ItemDamage; cItemHandler * ItemHandler = cItemHandler::GetItemHandler(Equipped.m_ItemType); if (ItemHandler->IsPlaceable() && (a_BlockFace != BLOCK_FACE_NONE)) { HandlePlaceBlock(a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_CursorX, a_CursorY, a_CursorZ, *ItemHandler); } - else if ((ItemHandler->IsFood() || ItemHandler->IsDrinkable(&Equipped)) && !m_Player->IsGameModeCreative()) + else if ((ItemHandler->IsFood() || ItemHandler->IsDrinkable(EquippedDamage)) && !m_Player->IsGameModeCreative()) { - if (m_Player->IsSatiated() && !ItemHandler->IsDrinkable(&Equipped)) + if (m_Player->IsSatiated() && !ItemHandler->IsDrinkable(EquippedDamage)) { // The player is satiated, they cannot eat return; |