]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Purges the one remaining use of TransformComponent.WorldPosition in content. (#34943)
authorTemporalOroboros <TemporalOroboros@gmail.com>
Mon, 10 Feb 2025 11:40:25 +0000 (03:40 -0800)
committerGitHub <noreply@github.com>
Mon, 10 Feb 2025 11:40:25 +0000 (22:40 +1100)
Content.Client/UserInterface/Systems/Viewport/ViewportUIController.cs

index 613f71e79b25e003c24c992627f76638639389f9..ffee14ad9a3ba44317c9f50a5a1e3b2dcae3e2d4 100644 (file)
@@ -3,6 +3,7 @@ using Content.Client.UserInterface.Systems.Gameplay;
 using Content.Shared.CCVar;
 using Robust.Client.Graphics;
 using Robust.Client.Player;
+using Robust.Client.UserInterface;
 using Robust.Client.UserInterface.Controllers;
 using Robust.Shared.Configuration;
 using Robust.Shared.Timing;
@@ -15,6 +16,7 @@ public sealed class ViewportUIController : UIController
     [Dependency] private readonly IPlayerManager _playerMan = default!;
     [Dependency] private readonly IEntityManager _entMan = default!;
     [Dependency] private readonly IConfigurationManager _configurationManager = default!;
+    [UISystemDependency] private readonly SharedTransformSystem? _transformSystem = default!;
     public static readonly Vector2i ViewportSize = (EyeManager.PixelsPerMeter * 21, EyeManager.PixelsPerMeter * 15);
     public const int ViewportHeight = 15;
     private MainViewport? Viewport => UIManager.ActiveScreen?.GetWidget<MainViewport>();
@@ -93,7 +95,7 @@ public sealed class ViewportUIController : UIController
         _entMan.TryGetComponent(ent, out EyeComponent? eye);
 
         if (eye?.Eye == _eyeManager.CurrentEye
-            && _entMan.GetComponent<TransformComponent>(ent.Value).WorldPosition == default)
+            && (_transformSystem is null || _transformSystem.GetWorldPosition(ent.Value) == default))
             return; // nothing to worry about, the player is just in null space... actually that is probably a problem?
 
         // Currently, this shouldn't happen. This likely happened because the main eye was set to null. When this