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:
+6
-32
@@ -197,11 +197,11 @@ void cWorld::BroadcastChat(const cCompositeChat & a_Message, const cClientHandle
|
||||
|
||||
|
||||
|
||||
void cWorld::BroadcastCollectEntity(const cEntity & a_Entity, const cPlayer & a_Player, int a_Count, const cClientHandle * a_Exclude)
|
||||
void cWorld::BroadcastCollectEntity(const cEntity & a_Collected, const cEntity & a_Collector, unsigned a_Count, const cClientHandle * a_Exclude)
|
||||
{
|
||||
ForClientsWithEntity(a_Entity, *this, a_Exclude, [&](cClientHandle & a_Client)
|
||||
ForClientsWithEntity(a_Collected, *this, a_Exclude, [&](cClientHandle & a_Client)
|
||||
{
|
||||
a_Client.SendCollectEntity(a_Entity, a_Player, a_Count);
|
||||
a_Client.SendCollectEntity(a_Collected, a_Collector, a_Count);
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -314,24 +314,11 @@ void cWorld::BroadcastEntityMetadata(const cEntity & a_Entity, const cClientHand
|
||||
|
||||
|
||||
|
||||
void cWorld::BroadcastEntityRelMove(const cEntity & a_Entity, Vector3<Int8> a_RelMove, const cClientHandle * a_Exclude)
|
||||
void cWorld::BroadcastEntityPosition(const cEntity & a_Entity, const cClientHandle * a_Exclude)
|
||||
{
|
||||
ForClientsWithEntity(a_Entity, *this, a_Exclude, [&](cClientHandle & a_Client)
|
||||
ForClientsInWorld(*this, a_Exclude, [&](cClientHandle & a_Client)
|
||||
{
|
||||
a_Client.SendEntityRelMove(a_Entity, a_RelMove.x, a_RelMove.y, a_RelMove.z);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void cWorld::BroadcastEntityRelMoveLook(const cEntity & a_Entity, Vector3<Int8> a_RelMove, const cClientHandle * a_Exclude)
|
||||
{
|
||||
ForClientsWithEntity(a_Entity, *this, a_Exclude, [&](cClientHandle & a_Client)
|
||||
{
|
||||
a_Client.SendEntityRelMoveLook(a_Entity, a_RelMove.x, a_RelMove.y, a_RelMove.z);
|
||||
a_Client.SendEntityPosition(a_Entity);
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -561,19 +548,6 @@ void cWorld::BroadcastSpawnEntity(cEntity & a_Entity, const cClientHandle * a_Ex
|
||||
|
||||
|
||||
|
||||
void cWorld::BroadcastTeleportEntity(const cEntity & a_Entity, const cClientHandle * a_Exclude)
|
||||
{
|
||||
ForClientsInWorld(*this, a_Exclude, [&](cClientHandle & a_Client)
|
||||
{
|
||||
a_Client.SendTeleportEntity(a_Entity);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void cWorld::BroadcastThunderbolt(Vector3i a_BlockPos, const cClientHandle * a_Exclude)
|
||||
{
|
||||
ForClientsWithChunkAtPos(a_BlockPos, *this, a_Exclude, [&](cClientHandle & a_Client)
|
||||
|
||||
Reference in New Issue
Block a user