Back to old latency compensation

This commit is contained in:
Sardelka
2022-07-21 09:53:07 +08:00
parent 9ba52b332c
commit b0a197cd18

View File

@ -124,9 +124,15 @@ namespace RageCoop.Client
return;
}
}
DisplayVehicle();
// Skip update if no new sync message has arrived.
if (!NeedUpdate) { return; }
if (!NeedUpdate) {
if (Velocity.Length()<3)
{
DisplayVehicle();
}
return;
}
DisplayVehicle();
#endregion
#region -- SYNC CRITICAL --
if (SteeringAngle != MainVehicle.SteeringAngle)
@ -334,7 +340,7 @@ namespace RageCoop.Client
void DisplayVehicle()
{
var current = MainVehicle.Position;
var predicted = Position+Velocity*(Networking.Latency+0.001f*LastSyncedStopWatch.ElapsedMilliseconds);
var predicted = Position+Velocity*(SyncParameters.PositioinPredictionDefault+0.001f*LastSyncedStopWatch.ElapsedMilliseconds);
if (current.DistanceTo(Main.PlayerPosition)>50)
{
MainVehicle.Position=predicted;