summaryrefslogtreecommitdiffstats
path: root/source/cClientHandle.cpp
diff options
context:
space:
mode:
authormtilden@gmail.com <mtilden@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-12-29 16:31:48 +0100
committermtilden@gmail.com <mtilden@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-12-29 16:31:48 +0100
commitd7adbba59d2372234a616b87f8b3b5a03888ddbc (patch)
treeee465a22205a21de84b57b931a15942382acc9a0 /source/cClientHandle.cpp
parentM$ BS... (diff)
downloadcuberite-d7adbba59d2372234a616b87f8b3b5a03888ddbc.tar
cuberite-d7adbba59d2372234a616b87f8b3b5a03888ddbc.tar.gz
cuberite-d7adbba59d2372234a616b87f8b3b5a03888ddbc.tar.bz2
cuberite-d7adbba59d2372234a616b87f8b3b5a03888ddbc.tar.lz
cuberite-d7adbba59d2372234a616b87f8b3b5a03888ddbc.tar.xz
cuberite-d7adbba59d2372234a616b87f8b3b5a03888ddbc.tar.zst
cuberite-d7adbba59d2372234a616b87f8b3b5a03888ddbc.zip
Diffstat (limited to '')
-rw-r--r--source/cClientHandle.cpp43
1 files changed, 30 insertions, 13 deletions
diff --git a/source/cClientHandle.cpp b/source/cClientHandle.cpp
index 920963c28..6badd5ae1 100644
--- a/source/cClientHandle.cpp
+++ b/source/cClientHandle.cpp
@@ -784,51 +784,63 @@ void cClientHandle::HandlePacket( cPacket* a_Packet )
switch( Item.m_ItemID )
{
case E_ITEM_APPLE:
- m_Player->Heal( 4 ); // 2 hearts
+ //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->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->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->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->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->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->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->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->Heal(3);
+ m_Player->Feed( 12 ); // 1 food
bEat = true;
break;
case E_ITEM_COOKED_CHICKEN:
- m_Player->Heal( 8 );
+ //m_Player->Heal( 8 );
+ m_Player->Feed( 36 ); // 3 food
bEat = true;
break;
case E_ITEM_RAW_BEEF:
- m_Player->Heal(3);
+ //m_Player->Heal(3);
+ m_Player->Feed( 18 ); // 1.5 food
bEat = true;
break;
case E_ITEM_STEAK:
- m_Player->Heal( 8 );
+ //m_Player->Heal( 8 );
+ m_Player->Feed( 48 ); // 4 food
bEat = true;
break;
default:
@@ -1293,7 +1305,12 @@ void cClientHandle::Tick(float a_Dt)
m_Player->GetInventory().SendWholeInventory( this );
// Send health
- Send( cPacket_UpdateHealth( (short)m_Player->GetHealth() ) );
+ cPacket_UpdateHealth Health;
+ Health.m_Health = (short)m_Player->GetHealth();
+ Health.m_Food = m_Player->GetFood();
+ Health.m_Saturation = m_Player->GetFoodSaturation();
+ Send(Health);
+ //Send( cPacket_UpdateHealth( (short)m_Player->GetHealth() ) );
World->UnlockEntities();
}