From c4ecb1678a7c6bd3bc1b4b1b59da1802419102fd Mon Sep 17 00:00:00 2001 From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Mon, 7 Mar 2022 20:05:44 +1300 Subject: [PATCH] Fix more movement-rotation issues (#7016) --- Content.Shared/Movement/SharedMoverController.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Content.Shared/Movement/SharedMoverController.cs b/Content.Shared/Movement/SharedMoverController.cs index f895371ce7..74f22cf7d7 100644 --- a/Content.Shared/Movement/SharedMoverController.cs +++ b/Content.Shared/Movement/SharedMoverController.cs @@ -86,7 +86,9 @@ namespace Content.Shared.Movement mover.LastGridAngle = parentRotation; if (worldTotal != Vector2.Zero) - transform.WorldRotation = worldTotal.GetDir().ToAngle(); + transform.LocalRotation = transform.GridID != GridId.Invalid + ? total.ToWorldAngle() + : worldTotal.ToWorldAngle(); _physics.SetLinearVelocity(physicsComponent, worldTotal); } @@ -149,7 +151,9 @@ namespace Content.Shared.Movement { // This should have its event run during island solver soooo xform.DeferUpdates = true; - xform.LocalRotation = total.GetDir().ToAngle(); + xform.LocalRotation = xform.GridID != GridId.Invalid + ? total.ToWorldAngle() + : worldTotal.ToWorldAngle(); xform.DeferUpdates = false; HandleFootsteps(mover, mobMover); }