Further improvements to item position syncing

Still needs some work
This commit is contained in:
juanjp600
2017-03-09 23:49:12 -03:00
parent c55c1b6d0e
commit 4f589603d1
+5 -5
View File
@@ -810,10 +810,10 @@ namespace Barotrauma
UpdateNetPosition(deltaTime); UpdateNetPosition(deltaTime);
if (GameMain.Client != null) /*if (GameMain.Client != null)
{ {
body.MoveToTargetPosition(); body.MoveToTargetPosition();
} }*/
if (!inWater || Container != null || body == null) return; if (!inWater || Container != null || body == null) return;
@@ -2126,14 +2126,14 @@ namespace Barotrauma
body.FarseerBody.Enabled = false; body.FarseerBody.Enabled = false;
} }
if ((newPosition - SimPosition).Length() > body.LinearVelocity.Length() * 3.0f + 24.0f) if ((newPosition - SimPosition).Length() > body.LinearVelocity.Length() * 2.0f)
{ {
body.SetTransform(newPosition,newRotation); body.SetTransform(newPosition,newRotation);
} }
DebugConsole.NewMessage("Received item pos, t: "+sendingTime+ " ("+Name+")", Color.LightGreen); //DebugConsole.NewMessage("Received item pos, t: "+sendingTime+ " ("+Name+")", Color.LightGreen);
/* //already interpolating with more up-to-date data -> ignore /*//already interpolating with more up-to-date data -> ignore
if (MemPos.Count > 1 && MemPos[0].Timestamp > sendingTime) if (MemPos.Count > 1 && MemPos[0].Timestamp > sendingTime)
{ {
return; return;