Fix more movement-rotation issues (#7016)

This commit is contained in:
Leon Friedrich
2022-03-07 20:05:44 +13:00
committed by GitHub
parent 4723c6bdda
commit c4ecb1678a

View File

@@ -86,7 +86,9 @@ namespace Content.Shared.Movement
mover.LastGridAngle = parentRotation; mover.LastGridAngle = parentRotation;
if (worldTotal != Vector2.Zero) if (worldTotal != Vector2.Zero)
transform.WorldRotation = worldTotal.GetDir().ToAngle(); transform.LocalRotation = transform.GridID != GridId.Invalid
? total.ToWorldAngle()
: worldTotal.ToWorldAngle();
_physics.SetLinearVelocity(physicsComponent, worldTotal); _physics.SetLinearVelocity(physicsComponent, worldTotal);
} }
@@ -149,7 +151,9 @@ namespace Content.Shared.Movement
{ {
// This should have its event run during island solver soooo // This should have its event run during island solver soooo
xform.DeferUpdates = true; xform.DeferUpdates = true;
xform.LocalRotation = total.GetDir().ToAngle(); xform.LocalRotation = xform.GridID != GridId.Invalid
? total.ToWorldAngle()
: worldTotal.ToWorldAngle();
xform.DeferUpdates = false; xform.DeferUpdates = false;
HandleFootsteps(mover, mobMover); HandleFootsteps(mover, mobMover);
} }