]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix pointing arrow trajectory (#25061)
authorKrunklehorn <42424291+Krunklehorn@users.noreply.github.com>
Mon, 12 Feb 2024 06:45:09 +0000 (01:45 -0500)
committerGitHub <noreply@github.com>
Mon, 12 Feb 2024 06:45:09 +0000 (23:45 -0700)
Initial commit

Content.Client/Pointing/PointingSystem.Visualizer.cs

index 63ce882e060bf444c3613df9526e2baf76f01535..e15923618ad708fdc63a710259a3a247d337c98e 100644 (file)
@@ -1,7 +1,8 @@
 using Content.Client.Pointing.Components;
 using Content.Shared.Pointing;
-using Robust.Client.GameObjects;
 using Robust.Client.Animations;
+using Robust.Client.GameObjects;
+using Robust.Client.Graphics;
 using Robust.Shared.Animations;
 using System.Numerics;
 
@@ -9,7 +10,9 @@ namespace Content.Client.Pointing;
 
 public sealed partial class PointingSystem : SharedPointingSystem
 {
+    [Dependency] private readonly IEyeManager _eyeManager = default!;
     [Dependency] private readonly AnimationPlayerSystem _animationPlayer = default!;
+    [Dependency] private readonly TransformSystem _transformSystem = default!;
 
     public void InitializeVisualizer()
     {
@@ -27,6 +30,8 @@ public sealed partial class PointingSystem : SharedPointingSystem
         if (_animationPlayer.HasRunningAnimation(uid, animationKey))
             return;
 
+        startPosition = new Angle(_eyeManager.CurrentEye.Rotation + _transformSystem.GetWorldRotation(uid)).RotateVec(startPosition);
+
         var animation = new Animation
         {
             Length = PointDuration,