Unstable 0.1300.0.3

This commit is contained in:
Markus Isberg
2021-03-25 15:40:24 +02:00
parent 874616027b
commit 58c50a235d
136 changed files with 2486 additions and 1008 deletions
@@ -713,7 +713,7 @@ namespace Barotrauma
public void SetPrevTransform(Vector2 simPosition, float rotation)
{
#if DEBUG || UNSTABLE
#if DEBUG
if (!IsValidValue(simPosition, "position", -1e10f, 1e10f)) { return; }
if (!IsValidValue(rotation, "rotation")) { return; }
#endif
@@ -756,12 +756,12 @@ namespace Barotrauma
Vector2 vel = FarseerBody.LinearVelocity;
Vector2 deltaPos = simPosition - (Vector2)pullPos;
#if DEBUG
if (deltaPos.LengthSquared() > 100.0f * 100.0f)
{
#if DEBUG || UNSTABLE
DebugConsole.ThrowError("Attempted to move a physics body to an invalid position.\n" + Environment.StackTrace.CleanupStackTrace());
#endif
}
#endif
deltaPos *= force;
ApplyLinearImpulse((deltaPos - vel * 0.5f) * FarseerBody.Mass, (Vector2)pullPos);
}