Sending NetTime at the start of a combined networkevent instead of individual networkevents, syncing itemcomponents for spectators, AICharacter importantentityupdates are sent again, misc bugfixes, some new heads

This commit is contained in:
Regalis
2015-11-20 17:12:33 +02:00
parent 8ec7fd44ff
commit cddf4f1bde
37 changed files with 269 additions and 130 deletions
+12 -2
View File
@@ -195,9 +195,19 @@ namespace Barotrauma
Vector2 translateAmount = speed * deltaTime;
translateAmount += ConvertUnits.ToDisplayUnits(body.Position) * collisionRigidness;
if (targetPosition != Vector2.Zero && Vector2.Distance(targetPosition, sub.Position) > 50.0f)
if (targetPosition != Vector2.Zero && targetPosition != sub.Position)
{
translateAmount += (targetPosition - sub.Position) * 0.01f;
float dist = Vector2.Distance(targetPosition, sub.Position);
if (dist>1000.0f)
{
sub.SetPosition(targetPosition);
targetPosition = Vector2.Zero;
}
else if (dist>50.0f)
{
translateAmount += (targetPosition - sub.Position) * 0.01f;
}
}
else
{