summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol_1_8.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2021-01-06 01:35:42 +0100
committerTiger Wang <ziwei.tiger@outlook.com>2021-01-12 13:34:34 +0100
commit054a89dd9e5d6819adede9d7ba781b69f98ff2f4 (patch)
tree820a104cae2d9e4ec912b0a1bd7debac52cf4cc9 /src/Protocol/Protocol_1_8.cpp
parentConvert most calls to blocking GetHeight/GetBiomeAt to direct chunk accesses (diff)
downloadcuberite-054a89dd9e5d6819adede9d7ba781b69f98ff2f4.tar
cuberite-054a89dd9e5d6819adede9d7ba781b69f98ff2f4.tar.gz
cuberite-054a89dd9e5d6819adede9d7ba781b69f98ff2f4.tar.bz2
cuberite-054a89dd9e5d6819adede9d7ba781b69f98ff2f4.tar.lz
cuberite-054a89dd9e5d6819adede9d7ba781b69f98ff2f4.tar.xz
cuberite-054a89dd9e5d6819adede9d7ba781b69f98ff2f4.tar.zst
cuberite-054a89dd9e5d6819adede9d7ba781b69f98ff2f4.zip
Diffstat (limited to 'src/Protocol/Protocol_1_8.cpp')
-rw-r--r--src/Protocol/Protocol_1_8.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/Protocol/Protocol_1_8.cpp b/src/Protocol/Protocol_1_8.cpp
index 12e2d441c..be855678e 100644
--- a/src/Protocol/Protocol_1_8.cpp
+++ b/src/Protocol/Protocol_1_8.cpp
@@ -670,8 +670,7 @@ void cProtocol_1_8_0::SendHeldItemChange(int a_ItemIndex)
ASSERT((a_ItemIndex >= 0) && (a_ItemIndex <= 8)); // Valid check
cPacketizer Pkt(*this, pktHeldItemChange);
- cPlayer * Player = m_Client->GetPlayer();
- Pkt.WriteBEInt8(static_cast<Int8>(Player->GetInventory().GetEquippedSlotNum()));
+ Pkt.WriteBEInt8(static_cast<Int8>(a_ItemIndex));
}
@@ -1021,15 +1020,11 @@ void cProtocol_1_8_0::SendPlayerListUpdatePing(const cPlayer & a_Player)
{
ASSERT(m_State == 3); // In game mode?
- auto ClientHandle = a_Player.GetClientHandlePtr();
- if (ClientHandle != nullptr)
- {
- cPacketizer Pkt(*this, pktPlayerList);
- Pkt.WriteVarInt32(2);
- Pkt.WriteVarInt32(1);
- Pkt.WriteUUID(a_Player.GetUUID());
- Pkt.WriteVarInt32(static_cast<UInt32>(ClientHandle->GetPing()));
- }
+ cPacketizer Pkt(*this, pktPlayerList);
+ Pkt.WriteVarInt32(2);
+ Pkt.WriteVarInt32(1);
+ Pkt.WriteUUID(a_Player.GetUUID());
+ Pkt.WriteVarInt32(static_cast<UInt32>(a_Player.GetClientHandle()->GetPing()));
}