1
0

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
This commit is contained in:
Tiger Wang
2020-05-04 09:10:47 +01:00
committed by GitHub
parent 258318ab98
commit 07ca095740
23 changed files with 294 additions and 404 deletions

View File

@@ -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);