]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix static melee effect offsets (#14815)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Fri, 24 Mar 2023 02:13:15 +0000 (13:13 +1100)
committerGitHub <noreply@github.com>
Fri, 24 Mar 2023 02:13:15 +0000 (13:13 +1100)
Content.Client/Weapons/Melee/MeleeWeaponSystem.Effects.cs

index 5c423d03153aba1d38b418d8ae4f2cf5ba612d4d..6631197f814e2592d6a5e66a4dec480f7e94867d 100644 (file)
@@ -153,10 +153,13 @@ public sealed partial class MeleeWeaponSystem
                     _animation.Play(animationUid, GetFadeAnimation(sprite, 0.05f, 0.15f), FadeAnimationKey);
                 break;
             case WeaponArcAnimation.None:
-                var (mapPos, mapRot) = _transform.GetWorldPositionRotation(userXform, GetEntityQuery<TransformComponent>());
-                var xform = Transform(animationUid);
+                var xformQuery = GetEntityQuery<TransformComponent>();
+                var (mapPos, mapRot) = _transform.GetWorldPositionRotation(userXform, xformQuery);
+                var xform = xformQuery.GetComponent(animationUid);
                 xform.AttachToGridOrMap();
-                _transform.SetWorldPosition(xform, mapPos + (mapRot - userXform.LocalRotation).RotateVec(localPos));
+                var worldPos = mapPos + (mapRot - userXform.LocalRotation).RotateVec(localPos);
+                var newLocalPos = _transform.GetInvWorldMatrix(xform.ParentUid, xformQuery).Transform(worldPos);
+                _transform.SetLocalPositionNoLerp(xform, newLocalPos);
                 if (arcComponent.Fadeout)
                     _animation.Play(animationUid, GetFadeAnimation(sprite, 0f, 0.15f), FadeAnimationKey);
                 break;