(e9f10995d) Merge branch 'bugreporterUI' into dev

This commit is contained in:
Joonas Rikkonen
2019-05-18 17:43:00 +03:00
parent 3a2310e547
commit 78b67de866
52 changed files with 428 additions and 223 deletions
@@ -192,6 +192,13 @@ namespace Barotrauma
if (dist > maxDistance) return Vector2.Zero;
if (!avoidObstaclePos.HasValue) return Vector2.Zero;
Vector2 diff = avoidObstaclePos.Value - host.SimPosition;
float dist = diff.Length();
if (dist > maxDistance) return Vector2.Zero;
return -diff * (1.0f - dist / maxDistance) * weight;
}