summaryrefslogtreecommitdiffstats
path: root/source/cClientHandle.cpp
diff options
context:
space:
mode:
authorlapayo94@gmail.com <lapayo94@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-07-17 14:02:03 +0200
committerlapayo94@gmail.com <lapayo94@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-07-17 14:02:03 +0200
commitf473f13585e1bc901bfeb05cd5a9bb35489595da (patch)
tree48d9f165c1c154ae5baefe9712b990f837edfd37 /source/cClientHandle.cpp
parentFixed compilation on OS X and maybe *nix as well (diff)
downloadcuberite-f473f13585e1bc901bfeb05cd5a9bb35489595da.tar
cuberite-f473f13585e1bc901bfeb05cd5a9bb35489595da.tar.gz
cuberite-f473f13585e1bc901bfeb05cd5a9bb35489595da.tar.bz2
cuberite-f473f13585e1bc901bfeb05cd5a9bb35489595da.tar.lz
cuberite-f473f13585e1bc901bfeb05cd5a9bb35489595da.tar.xz
cuberite-f473f13585e1bc901bfeb05cd5a9bb35489595da.tar.zst
cuberite-f473f13585e1bc901bfeb05cd5a9bb35489595da.zip
Diffstat (limited to '')
-rw-r--r--source/cClientHandle.cpp17
1 files changed, 3 insertions, 14 deletions
diff --git a/source/cClientHandle.cpp b/source/cClientHandle.cpp
index 76aaf2724..5bbf0f512 100644
--- a/source/cClientHandle.cpp
+++ b/source/cClientHandle.cpp
@@ -339,11 +339,7 @@ void cClientHandle::Authenticate(void)
m_Player->GetInventory().SendWholeInventory(this);
// Send health
- cPacket_UpdateHealth Health;
- Health.m_Health = (short)m_Player->GetHealth();
- Health.m_Food = m_Player->GetFood();
- Health.m_Saturation = m_Player->GetFoodSaturation();
- Send(Health);
+ m_Player->SendHealth();
m_Player->Initialize(World);
StreamChunks();
@@ -856,14 +852,7 @@ void cClientHandle::HandleBlockDig(cPacket_BlockDig * a_Packet)
void cClientHandle::HandleBlockPlace(cPacket_BlockPlace * a_Packet)
{
- if(a_Packet->m_PosX == -1
- && a_Packet->m_PosY == 255
- && a_Packet->m_PosZ == -1)
- {
- //I donīt know whats the idea behind these packets O.o
- return;
- }
-
+
if (!CheckBlockInteractionsRate())
{
return;
@@ -960,7 +949,7 @@ void cClientHandle::HandleBlockPlace(cPacket_BlockPlace * a_Packet)
cItem Item;
Item.m_ItemID = Equipped.m_ItemID;
Item.m_ItemCount = 1;
- if (m_Player->EatItem(Item.m_ItemID))
+ if (ItemHandler->EatItem(m_Player, &Item))
{
ItemHandler->OnFoodEaten(World, m_Player, &Item);
m_Player->GetInventory().RemoveItem(Item);