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:
@@ -49,19 +49,11 @@ void cBoat::BroadcastMovementUpdate(const cClientHandle * a_Exclude)
|
||||
}
|
||||
|
||||
Vector3i Diff = (GetPosition() * 32.0).Floor() - (m_LastSentPosition * 32.0).Floor();
|
||||
|
||||
if (Diff.HasNonZeroLength()) // Have we moved?
|
||||
{
|
||||
if ((abs(Diff.x) <= 127) && (abs(Diff.y) <= 127) && (abs(Diff.z) <= 127)) // Limitations of a Byte
|
||||
{
|
||||
m_World->BroadcastEntityRelMove(*this, Vector3<Int8>(Diff), a_Exclude);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Too big a movement, do a teleport
|
||||
m_World->BroadcastTeleportEntity(*this, a_Exclude);
|
||||
}
|
||||
m_World->BroadcastEntityPosition(*this, a_Exclude);
|
||||
m_LastSentPosition = GetPosition();
|
||||
m_bDirtyOrientation = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user