summaryrefslogtreecommitdiffstats
path: root/source/cClientHandle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/cClientHandle.cpp')
-rw-r--r--source/cClientHandle.cpp73
1 files changed, 2 insertions, 71 deletions
diff --git a/source/cClientHandle.cpp b/source/cClientHandle.cpp
index 9920b68f8..f5aa9024d 100644
--- a/source/cClientHandle.cpp
+++ b/source/cClientHandle.cpp
@@ -981,77 +981,7 @@ void cClientHandle::HandleBlockPlace(cPacket_BlockPlace * a_Packet)
a_Packet->m_PosX, a_Packet->m_PosY, a_Packet->m_PosZ
);
- // Hacked in edible items go!~
- // TODO: Handle hunger
- bool bEat = false;
- bool isDoor = false;
- switch (Item.m_ItemID)
- {
- case E_ITEM_APPLE:
- //m_Player->Heal(4); // 2 hearts
- m_Player->Feed(24); // 2 food bars
- bEat = true;
- break;
- case E_ITEM_GOLDEN_APPLE:
- //m_Player->Heal(20); // 10 hearts
- m_Player->Feed(60); // 5 food
- bEat = true;
- break;
- case E_ITEM_MUSHROOM_SOUP:
- ///m_Player->Heal(10); // 5 hearts
- m_Player->Feed(48); // 4 food
- bEat = true;
- break;
- case E_ITEM_BREAD:
- //m_Player->Heal(5); // 2.5 hearts
- m_Player->Feed(30); // 2.5 food
- bEat = true;
- break;
- case E_ITEM_RAW_MEAT:
- //m_Player->Heal(3); // 1.5 hearts
- m_Player->Feed(18); // 1.5 food
- bEat = true;
- break;
- case E_ITEM_COOKED_MEAT:
- //m_Player->Heal(8); // 4 hearts
- m_Player->Feed(48); // 4 food
- bEat = true;
- break;
- case E_ITEM_RAW_FISH:
- //m_Player->Heal(2); // 1 heart
- m_Player->Feed(12); // 1 food
- bEat = true;
- break;
- case E_ITEM_COOKED_FISH:
- //m_Player->Heal(5); // 2.5 hearts
- m_Player->Feed(30); // 2.5 food
- bEat = true;
- break;
- case E_ITEM_RAW_CHICKEN:
- //m_Player->Heal(3);
- m_Player->Feed(12); // 1 food
- bEat = true;
- break;
- case E_ITEM_COOKED_CHICKEN:
- //m_Player->Heal(8);
- m_Player->Feed(36); // 3 food
- bEat = true;
- break;
- case E_ITEM_RAW_BEEF:
- //m_Player->Heal(3);
- m_Player->Feed(18); // 1.5 food
- bEat = true;
- break;
- case E_ITEM_STEAK:
- //m_Player->Heal(8);
- m_Player->Feed(48); // 4 food
- bEat = true;
- break;
- default:
- break;
- };
-
- if (bEat)
+ if (m_Player->EatItem(Item.m_ItemID))
{
m_Player->GetInventory().RemoveItem(Item);
return;
@@ -1062,6 +992,7 @@ void cClientHandle::HandleBlockPlace(cPacket_BlockPlace * a_Packet)
// clicked in air
return;
}
+ bool isDoor = false;
//TODO: Wrong Blocks!
int ClickedBlock = (int)m_Player->GetWorld()->GetBlock(a_Packet->m_PosX, a_Packet->m_PosY, a_Packet->m_PosZ);