Collider-controlled swimming, fixes

This commit is contained in:
Regalis
2016-10-16 20:07:34 +03:00
parent db8c2b9f8e
commit f3e74a6a41
14 changed files with 243 additions and 226 deletions
@@ -62,6 +62,13 @@ namespace Barotrauma
public virtual void Update(float speed = 1.0f)
{
if (steering == Vector2.Zero || !MathUtils.IsValid(steering))
{
steering = Vector2.Zero;
host.Steering = Vector2.Zero;
return;
}
float steeringSpeed = steering.Length();
if (steeringSpeed>speed)
{