This commit is contained in:
Regalis
2016-03-03 22:05:18 +02:00
+7 -6
View File
@@ -469,12 +469,13 @@ namespace Barotrauma
var uplift = -GameMain.World.Gravity*(forceFactor - body.body.LinearVelocity.Y*5); var uplift = -GameMain.World.Gravity*(forceFactor - body.body.LinearVelocity.Y*5);
body.body.FarseerBody.ApplyForce(uplift*deltaTime); body.body.FarseerBody.ApplyForce(uplift*deltaTime);
var gap = ConnectedGaps.Where(i => i.Open > 0).OrderBy(i => i.LerpedFlowForce.Length()).FirstOrDefault(); foreach (var gap in ConnectedGaps.Where(gap => gap.Open > 0))
if (gap == null || gap.LerpedFlowForce.Length() < 0) {
return; var pos = gap.Position - body.Position;
var pos = gap.Position - body.Position; pos.Normalize();
pos.Normalize(); body.body.ApplyForce((pos * gap.LerpedFlowForce) * deltaTime);
body.body.ApplyForce((pos*gap.LerpedFlowForce)*deltaTime); }
} }
public void Extinquish(float deltaTime, float amount, Vector2 position) public void Extinquish(float deltaTime, float amount, Vector2 position)