From 07ca09574072b303064eafb2751f8f83c865f083 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Mon, 4 May 2020 09:10:47 +0100 Subject: Improve entity position updates (#4701) * Make puking pickups fly nicer * Improve entity position updates * Move determination of whether a delta is too big for a packet into the protocol handlers + Less jittery movement + Generalise CollectEntity to take any entity --- src/ClientHandle.cpp | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) (limited to 'src/ClientHandle.cpp') diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index cbe8249c2..43a9bc33e 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -2497,9 +2497,9 @@ void cClientHandle::SendChunkData(int a_ChunkX, int a_ChunkZ, cChunkDataSerializ -void cClientHandle::SendCollectEntity(const cEntity & a_Entity, const cPlayer & a_Player, int a_Count) +void cClientHandle::SendCollectEntity(const cEntity & a_Collected, const cEntity & a_Collector, unsigned a_Count) { - m_Protocol->SendCollectEntity(a_Entity, a_Player, a_Count); + m_Protocol->SendCollectEntity(a_Collected, a_Collector, a_Count); } @@ -2603,22 +2603,9 @@ void cClientHandle::SendEntityMetadata(const cEntity & a_Entity) -void cClientHandle::SendEntityRelMove(const cEntity & a_Entity, char a_RelX, char a_RelY, char a_RelZ) +void cClientHandle::SendEntityPosition(const cEntity & a_Entity) { - ASSERT(a_Entity.GetUniqueID() != m_Player->GetUniqueID()); // Must not send for self - - m_Protocol->SendEntityRelMove(a_Entity, a_RelX, a_RelY, a_RelZ); -} - - - - - -void cClientHandle::SendEntityRelMoveLook(const cEntity & a_Entity, char a_RelX, char a_RelY, char a_RelZ) -{ - ASSERT(a_Entity.GetUniqueID() != m_Player->GetUniqueID()); // Must not send for self - - m_Protocol->SendEntityRelMoveLook(a_Entity, a_RelX, a_RelY, a_RelZ); + m_Protocol->SendEntityPosition(a_Entity); } @@ -3058,15 +3045,6 @@ void cClientHandle::SendTabCompletionResults(const AStringVector & a_Results) -void cClientHandle::SendTeleportEntity(const cEntity & a_Entity) -{ - m_Protocol->SendTeleportEntity(a_Entity); -} - - - - - void cClientHandle::SendThunderbolt(int a_BlockX, int a_BlockY, int a_BlockZ) { m_Protocol->SendThunderbolt(a_BlockX, a_BlockY, a_BlockZ); -- cgit v1.2.3