summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol125.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-04-22 13:34:32 +0200
committerMattes D <github@xoft.cz>2014-04-22 13:34:32 +0200
commit6492aa000b322877aecda32573cc55b57abfc5ed (patch)
treef9f0f9211b42aa72729f8d6d444e4f48556e5fb9 /src/Protocol/Protocol125.cpp
parentAdded prefab hitboxes. (diff)
parentreverted the revert of the minecart collision detection fix. (diff)
downloadcuberite-6492aa000b322877aecda32573cc55b57abfc5ed.tar
cuberite-6492aa000b322877aecda32573cc55b57abfc5ed.tar.gz
cuberite-6492aa000b322877aecda32573cc55b57abfc5ed.tar.bz2
cuberite-6492aa000b322877aecda32573cc55b57abfc5ed.tar.lz
cuberite-6492aa000b322877aecda32573cc55b57abfc5ed.tar.xz
cuberite-6492aa000b322877aecda32573cc55b57abfc5ed.tar.zst
cuberite-6492aa000b322877aecda32573cc55b57abfc5ed.zip
Diffstat (limited to 'src/Protocol/Protocol125.cpp')
-rw-r--r--src/Protocol/Protocol125.cpp32
1 files changed, 18 insertions, 14 deletions
diff --git a/src/Protocol/Protocol125.cpp b/src/Protocol/Protocol125.cpp
index 9b8db0b7b..3282a827f 100644
--- a/src/Protocol/Protocol125.cpp
+++ b/src/Protocol/Protocol125.cpp
@@ -538,9 +538,10 @@ void cProtocol125::SendHealth(void)
{
cCSLock Lock(m_CSPacket);
WriteByte (PACKET_UPDATE_HEALTH);
- WriteShort((short)m_Client->GetPlayer()->GetHealth());
- WriteShort((short)m_Client->GetPlayer()->GetFoodLevel());
- WriteFloat((float)m_Client->GetPlayer()->GetFoodSaturationLevel());
+ cPlayer * Player = m_Client->GetPlayer();
+ WriteShort((short)Player->GetHealth());
+ WriteShort((short)Player->GetFoodLevel());
+ WriteFloat((float)Player->GetFoodSaturationLevel());
Flush();
}
@@ -668,13 +669,14 @@ void cProtocol125::SendPickupSpawn(const cPickup & a_Pickup)
cCSLock Lock(m_CSPacket);
WriteByte (PACKET_PICKUP_SPAWN);
WriteInt (a_Pickup.GetUniqueID());
- WriteShort (a_Pickup.GetItem().m_ItemType);
- WriteChar (a_Pickup.GetItem().m_ItemCount);
- WriteShort (a_Pickup.GetItem().m_ItemDamage);
+ const cItem & Item = a_Pickup.GetItem();
+ WriteShort (Item.m_ItemType);
+ WriteChar (Item.m_ItemCount);
+ WriteShort (Item.m_ItemDamage);
WriteVectorI((Vector3i)(a_Pickup.GetPosition() * 32));
- WriteByte ((char)(a_Pickup.GetSpeed().x * 8));
- WriteByte ((char)(a_Pickup.GetSpeed().y * 8));
- WriteByte ((char)(a_Pickup.GetSpeed().z * 8));
+ WriteByte ((char)(a_Pickup.GetSpeedX() * 8));
+ WriteByte ((char)(a_Pickup.GetSpeedY() * 8));
+ WriteByte ((char)(a_Pickup.GetSpeedZ() * 8));
Flush();
}
@@ -831,10 +833,11 @@ void cProtocol125::SendRemoveEntityEffect(const cEntity & a_Entity, int a_Effect
void cProtocol125::SendRespawn(void)
{
cCSLock Lock(m_CSPacket);
+ cPlayer * Player = m_Client->GetPlayer();
WriteByte (PACKET_RESPAWN);
- WriteInt ((int)(m_Client->GetPlayer()->GetWorld()->GetDimension()));
+ WriteInt ((int)(Player->GetWorld()->GetDimension()));
WriteByte (2); // TODO: Difficulty; 2 = Normal
- WriteChar ((char)m_Client->GetPlayer()->GetGameMode());
+ WriteChar ((char)Player->GetGameMode());
WriteShort (256); // Current world height
WriteString("default");
}
@@ -846,10 +849,11 @@ void cProtocol125::SendRespawn(void)
void cProtocol125::SendExperience(void)
{
cCSLock Lock(m_CSPacket);
+ cPlayer * Player = m_Client->GetPlayer();
WriteByte (PACKET_EXPERIENCE);
- WriteFloat (m_Client->GetPlayer()->GetXpPercentage());
- WriteShort (m_Client->GetPlayer()->GetXpLevel());
- WriteShort (m_Client->GetPlayer()->GetCurrentXp());
+ WriteFloat (Player->GetXpPercentage());
+ WriteShort (Player->GetXpLevel());
+ WriteShort (Player->GetCurrentXp());
Flush();
}