Networking bugfixes & optimization

This commit is contained in:
Regalis
2015-08-18 18:13:40 +03:00
parent bc4ea098f7
commit 00c64f0b20
35 changed files with 320 additions and 188 deletions

View File

@@ -505,7 +505,7 @@ namespace Subsurface
private void Translate(Vector2 amount)
{
if (amount == Vector2.Zero) return;
if (amount == Vector2.Zero || ! amount.IsValid()) return;
Level.Loaded.Move(-amount);
}
@@ -516,11 +516,6 @@ namespace Subsurface
speed += force/mass;
}
//public void Move(Vector2 amount)
//{
// speed = Vector2.Lerp(speed, amount, 0.05f);
//}
VoronoiCell collidingCell;
public bool OnCollision(Fixture f1, Fixture f2, Contact contact)
{
@@ -597,6 +592,8 @@ namespace Subsurface
return;
}
if (!speed.IsValid() || targetPosition.IsValid()) return;
//newTargetPosition = newTargetPosition + newSpeed * (float)(NetTime.Now - sendingTime);
targetPosition = newTargetPosition;