(7d0cf0d4f) Clamp forces in a bunch of more places where forces are applied to bodies

This commit is contained in:
Joonas Rikkonen
2019-04-03 16:21:38 +03:00
parent 0844f1eae4
commit 8de2eccff2
7 changed files with 26 additions and 20 deletions
@@ -1,4 +1,5 @@
using Barotrauma.Items.Components;
using Barotrauma.Networking;
using FarseerPhysics;
using Microsoft.Xna.Framework;
using System;
@@ -310,7 +311,7 @@ namespace Barotrauma
errorMsg);
continue;
}
character.AnimController.Collider.ApplyForce(force * limb.body.Mass);
character.AnimController.Collider.ApplyForce(force * limb.body.Mass, maxVelocity: NetConfig.MaxPhysicsBodyVelocity);
}
}
}
@@ -1,4 +1,5 @@
using FarseerPhysics;
using Barotrauma.Networking;
using FarseerPhysics;
using FarseerPhysics.Collision;
using FarseerPhysics.Common;
using FarseerPhysics.Dynamics;
@@ -368,7 +369,7 @@ namespace Barotrauma
public void ApplyForce(Vector2 force)
{
Body.ApplyForce(force);
Body.ApplyForce(force, maxVelocity: NetConfig.MaxPhysicsBodyVelocity);
}
public void SetPosition(Vector2 position)