]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Purges uses of TransformComponent.WorldRotation (#34946)
authorTemporalOroboros <TemporalOroboros@gmail.com>
Tue, 11 Feb 2025 03:16:20 +0000 (19:16 -0800)
committerGitHub <noreply@github.com>
Tue, 11 Feb 2025 03:16:20 +0000 (14:16 +1100)
Content.Client/Interaction/DragDropSystem.cs
Content.Client/Maps/GridDraggingSystem.cs
Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs
Content.Server/Atmos/EntitySystems/AtmosphereSystem.HighPressureDelta.cs
Content.Server/Explosion/EntitySystems/ExplosionGridTileFlood.cs
Content.Server/Explosion/EntitySystems/ExplosionSystem.GridMap.cs
Content.Server/Explosion/EntitySystems/ExplosionSystem.TileFill.cs
Content.Server/Standing/StandingStateSystem.cs
Content.Shared/Maps/TurfHelpers.cs

index 41459995796e9fc7b63ae299aa8ffa8ff8e749cf..969aaffe0722875ece82ddf0c9b38914539a5f21 100644 (file)
@@ -256,7 +256,7 @@ public sealed class DragDropSystem : SharedDragDropSystem
             dragSprite.DrawDepth = (int) DrawDepth.Overlays;
             if (!dragSprite.NoRotation)
             {
-                Transform(_dragShadow.Value).WorldRotation = Transform(_draggedEntity.Value).WorldRotation;
+                _transformSystem.SetWorldRotationNoLerp(_dragShadow.Value, _transformSystem.GetWorldRotation(_draggedEntity.Value));
             }
 
             // drag initiated
index 5bbf5ff500642a035c9c9b28fbe7c50b4fc4e018..a4883f73cf011321b98e749ce99ce0b7c3c70f0b 100644 (file)
@@ -121,7 +121,7 @@ public sealed class GridDraggingSystem : SharedGridDraggingSystem
 
         if (localToWorld.EqualsApprox(mousePos.Position, 0.01f)) return;
 
-        var requestedGridOrigin = mousePos.Position - xform.WorldRotation.RotateVec(_localPosition);
+        var requestedGridOrigin = mousePos.Position - _transformSystem.GetWorldRotation(xform).RotateVec(_localPosition);
         _lastMousePosition = new MapCoordinates(requestedGridOrigin, mousePos.MapId);
 
         RaiseNetworkEvent(new GridDragRequestPosition()
index 57a312c3045cdc45aea3476c9309f764cc8ada67..08e86ff400dfc6973505b98163177e3bc04f8e20 100644 (file)
@@ -137,7 +137,7 @@ public sealed partial class AdminVerbSystem
                 var board = Spawn("ChessBoard", xform.Coordinates);
                 var session = _tabletopSystem.EnsureSession(Comp<TabletopGameComponent>(board));
                 xform.Coordinates = EntityCoordinates.FromMap(_mapManager, session.Position);
-                xform.WorldRotation = Angle.Zero;
+                _transformSystem.SetWorldRotationNoLerp((args.Target, xform), Angle.Zero);
             },
             Impact = LogImpact.Extreme,
             Message = string.Join(": ", chessName, Loc.GetString("admin-smite-chess-dimension-description"))
index 0b43c92414942f0c3f8ef3005ded8c06bf2c0f4b..6a5b07bb17a5e0b0e7bf6533b3b510cf14f7e621 100644 (file)
@@ -118,7 +118,7 @@ namespace Content.Server.Atmos.EntitySystems
                 return;
 
             // Used by ExperiencePressureDifference to correct push/throw directions from tile-relative to physics world.
-            var gridWorldRotation = xforms.GetComponent(gridAtmosphere).WorldRotation;
+            var gridWorldRotation = _transformSystem.GetWorldRotation(gridAtmosphere);
 
             // If we're using monstermos, smooth out the yeet direction to follow the flow
             if (MonstermosEqualization)
index 2ddcc052d85a9926f476db7e5791252d3d577233..556e3771d214c0f4a8e17fdb7d72bdb8ce6de773 100644 (file)
@@ -69,14 +69,17 @@ public sealed class ExplosionGridTileFlood : ExplosionTileFlood
             return;
 
         _needToTransform = true;
-        var transform = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Grid.Owner);
+        var entityManager = IoCManager.Resolve<IEntityManager>();
+
+        var transformSystem = entityManager.System<SharedTransformSystem>();
+        var transform = entityManager.GetComponent<TransformComponent>(Grid.Owner);
         var size = (float) Grid.TileSize;
 
         _matrix.M31 = size / 2;
         _matrix.M32 = size / 2;
         Matrix3x2.Invert(spaceMatrix, out var invSpace);
         _matrix *= transform.WorldMatrix * invSpace;
-        var relativeAngle = transform.WorldRotation - spaceAngle;
+        var relativeAngle = transformSystem.GetWorldRotation(transform) - spaceAngle;
         _offset = relativeAngle.RotateVec(new Vector2(size / 4, size / 4));
     }
 
index b08b66474b5de134ba6e926aa51d43355abdbe84..be6b9148a442376c1b4bb2fc74489ef0095d2990 100644 (file)
@@ -71,7 +71,7 @@ public sealed partial class ExplosionSystem
         {
             var targetGrid = Comp<MapGridComponent>(referenceGrid.Value);
             var xform = Transform(referenceGrid.Value);
-            targetAngle = xform.WorldRotation;
+            targetAngle = _transformSystem.GetWorldRotation(xform);
             targetMatrix = xform.InvWorldMatrix;
             tileSize = targetGrid.TileSize;
         }
index 7b73490d9467f59e2cd66904a2c376aa618b734e..2946748e5d89113166cc17e6c52eda457092ad71 100644 (file)
@@ -90,7 +90,7 @@ public sealed partial class ExplosionSystem
         {
             var xform = Transform(Comp<MapGridComponent>(referenceGrid.Value).Owner);
             spaceMatrix = xform.WorldMatrix;
-            spaceAngle = xform.WorldRotation;
+            spaceAngle = _transformSystem.GetWorldRotation(xform);
         }
 
         // is the explosion starting on a grid?
index e2b64958446d2e523b4ce2ca33f33ba441a1402b..bf9a4e4beaed3e2377abdd62137d4ab502593a6c 100644 (file)
@@ -13,6 +13,7 @@ public sealed class StandingStateSystem : EntitySystem
     [Dependency] private readonly IRobustRandom _random = default!;
     [Dependency] private readonly SharedHandsSystem _handsSystem = default!;
     [Dependency] private readonly ThrowingSystem _throwingSystem = default!;
+    [Dependency] private readonly SharedTransformSystem _transformSystem = default!;
 
     private void FallOver(EntityUid uid, StandingStateComponent component, DropHandItemsEvent args)
     {
@@ -25,7 +26,7 @@ public sealed class StandingStateSystem : EntitySystem
         if (!TryComp(uid, out HandsComponent? handsComp))
             return;
 
-        var worldRotation = EntityManager.GetComponent<TransformComponent>(uid).WorldRotation.ToVec();
+        var worldRotation = _transformSystem.GetWorldRotation(uid).ToVec();
         foreach (var hand in handsComp.Hands.Values)
         {
             if (hand.HeldEntity is not EntityUid held)
index 9a0b273c294d31b72f60e62e6e25a2a78b928d6f..71bbb35db7df623c9add9dcd0ffc50de88047e2d 100644 (file)
@@ -120,10 +120,11 @@ namespace Content.Shared.Maps
         private static bool GetWorldTileBox(TileRef turf, out Box2Rotated res)
         {
             var entManager = IoCManager.Resolve<IEntityManager>();
+            var xformSystem = entManager.System<SharedTransformSystem>();
 
             if (entManager.TryGetComponent<MapGridComponent>(turf.GridUid, out var tileGrid))
             {
-                var gridRot = entManager.GetComponent<TransformComponent>(turf.GridUid).WorldRotation;
+                var gridRot = xformSystem.GetWorldRotation(turf.GridUid);
 
                 // This is scaled to 90 % so it doesn't encompass walls on other tiles.
                 var tileBox = Box2.UnitCentered.Scale(0.9f);