]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Various sharedsystem spring cleaning (#36200)
authorJ <billsmith116@gmail.com>
Mon, 21 Apr 2025 18:40:31 +0000 (18:40 +0000)
committerGitHub <noreply@github.com>
Mon, 21 Apr 2025 18:40:31 +0000 (20:40 +0200)
* Various shared system warnings cleanup

* More shared system warnings cleanup

* Rearranging changes

* Using correct transform for unbuckle

* Small changes

* Revert buckle change

* Update Content.Shared/Ghost/SharedGhostSystem.cs

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
Content.Shared/Actions/SharedActionsSystem.cs
Content.Shared/Ensnaring/SharedEnsnareableSystem.cs
Content.Shared/Humanoid/SharedHumanoidAppearanceSystem.cs
Content.Shared/Interaction/SharedInteractionSystem.cs
Content.Shared/Magic/SharedMagicSystem.cs
Content.Shared/Shuttles/Systems/SharedShuttleSystem.cs
Content.Shared/Tabletop/SharedTabletopSystem.cs
Content.Shared/Teleportation/Systems/SharedPortalSystem.cs

index e4aa44cf54b2b247e4736ae3b102943cb4302c7c..174f2c7881adf023aced6d5374e97fd30081252a 100644 (file)
@@ -517,13 +517,12 @@ public abstract class SharedActionsSystem : EntitySystem
             // even if we don't check for obstructions, we may still need to check the range.
             var xform = Transform(user);
 
-            if (xform.MapID != coords.GetMapId(EntityManager))
+            if (xform.MapID != _transformSystem.GetMapId(coords))
                 return false;
 
             if (range <= 0)
                 return true;
-
-            return coords.InRange(EntityManager, _transformSystem, Transform(user).Coordinates, range);
+            return _transformSystem.InRange(coords, xform.Coordinates, range);
         }
 
         return _interactionSystem.InRangeUnobstructed(user, coords, range: range);
index dacb773470862d40a098b8e51f0d9990fd89ed1a..d15e80a0e30a6f503bf63ee0c864b625a5df4e23 100644 (file)
@@ -1,7 +1,4 @@
-using System.Linq;
 using Content.Shared.Alert;
-using Content.Shared.Body.Part;
-using Content.Shared.Body.Systems;
 using Content.Shared.CombatMode.Pacification;
 using Content.Shared.Damage.Components;
 using Content.Shared.Damage.Systems;
@@ -31,7 +28,6 @@ public abstract class SharedEnsnareableSystem : EntitySystem
     [Dependency] private   readonly MovementSpeedModifierSystem _speedModifier = default!;
     [Dependency] protected readonly SharedAppearanceSystem Appearance = default!;
     [Dependency] private   readonly SharedAudioSystem _audio = default!;
-    [Dependency] private   readonly SharedBodySystem _body = default!;
     [Dependency] protected readonly SharedContainerSystem Container = default!;
     [Dependency] private   readonly SharedDoAfterSystem _doAfter = default!;
     [Dependency] private   readonly SharedHandsSystem _hands = default!;
index a3f62fefe8394b4c9001f879639ad9781417b594..f7884e97c4d32080b1bc9becda204b13c902e992 100644 (file)
@@ -38,6 +38,7 @@ public abstract class SharedHumanoidAppearanceSystem : EntitySystem
     [Dependency] private readonly IPrototypeManager _proto = default!;
     [Dependency] private readonly ISerializationManager _serManager = default!;
     [Dependency] private readonly MarkingManager _markingManager = default!;
+    [Dependency] private readonly GrammarSystem _grammarSystem = default!;
 
     [ValidatePrototypeId<SpeciesPrototype>]
     public const string DefaultSpecies = "Human";
@@ -156,8 +157,9 @@ public abstract class SharedHumanoidAppearanceSystem : EntitySystem
         targetHumanoid.MarkingSet = new(sourceHumanoid.MarkingSet);
 
         targetHumanoid.Gender = sourceHumanoid.Gender;
+
         if (TryComp<GrammarComponent>(target, out var grammar))
-            grammar.Gender = sourceHumanoid.Gender;
+            _grammarSystem.SetGender((target, grammar), sourceHumanoid.Gender);
 
         Dirty(target, targetHumanoid);
     }
@@ -438,7 +440,7 @@ public abstract class SharedHumanoidAppearanceSystem : EntitySystem
         humanoid.Gender = profile.Gender;
         if (TryComp<GrammarComponent>(uid, out var grammar))
         {
-            grammar.Gender = profile.Gender;
+            _grammarSystem.SetGender((uid, grammar), profile.Gender);
         }
 
         humanoid.Age = profile.Age;
index 494fbdf032945512d5141cb6baad615988f75aac..f2ae9fd68e14ffaa25ec94b7a995b356486bbb51 100644 (file)
@@ -1319,7 +1319,7 @@ namespace Content.Shared.Interaction
             if (Deleted(target))
                 return false;
 
-            if (!_containerSystem.TryGetContainingContainer((target, null, null), out var container))
+            if (!_containerSystem.TryGetContainingContainer(target, out var container))
                 return false;
 
             var wearer = container.Owner;
index 9a44407e9120efdf363cd3038efe3e4b2b06cd37..5bf1fee0906d5c6612ea8e5ad15f60ea17753611 100644 (file)
@@ -279,14 +279,14 @@ public abstract class SharedMagicSystem : EntitySystem
         var userVelocity = _physics.GetMapLinearVelocity(ev.Performer);
 
         // If applicable, this ensures the projectile is parented to grid on spawn, instead of the map.
-        var fromMap = fromCoords.ToMap(EntityManager, _transform);
+        var fromMap = _transform.ToMapCoordinates(fromCoords);
         var spawnCoords = _mapManager.TryFindGridAt(fromMap, out var gridUid, out _)
-            ? fromCoords.WithEntityId(gridUid, EntityManager)
+            ? _transform.WithEntityId(fromCoords, gridUid)
             : new(_mapManager.GetMapEntityId(fromMap.MapId), fromMap.Position);
 
         var ent = Spawn(ev.Prototype, spawnCoords);
-        var direction = toCoords.ToMapPos(EntityManager, _transform) -
-                        spawnCoords.ToMapPos(EntityManager, _transform);
+        var direction = _transform.ToMapCoordinates(toCoords).Position -
+                         _transform.ToMapCoordinates(spawnCoords).Position;
         _gunSystem.ShootProjectile(ent, direction, userVelocity, ev.Performer, ev.Performer);
     }
     // End Projectile Spells
index b4034686d9786c6a0ceef1f5b560d77c7c24cef2..b9fc68330e72c416e5baeb6fe43fdb68a5da1829 100644 (file)
@@ -181,7 +181,7 @@ public abstract partial class SharedShuttleSystem : EntitySystem
 
         // Just checks if any grids inside of a buffer range at the target position.
         _grids.Clear();
-        var mapCoordinates = coordinates.ToMap(EntityManager, XformSystem);
+        var mapCoordinates = XformSystem.ToMapCoordinates(coordinates);
 
         var ourPos = Maps.GetGridPosition((shuttleUid, shuttlePhysics, shuttleXform));
 
index afa77a643a0116ba9caf2d9fdac27cdd490cdd88..7a2540b11d44266a9fab968853b046db92a4560f 100644 (file)
@@ -42,7 +42,7 @@ namespace Content.Shared.Tabletop
             // Move the entity and dirty it (we use the map ID from the entity so noone can try to be funny and move the item to another map)
             var transform = EntityManager.GetComponent<TransformComponent>(moved);
             Transforms.SetParent(moved, transform, _mapMan.GetMapEntityId(transform.MapID));
-            Transforms.SetLocalPositionNoLerp(transform, msg.Coordinates.Position);
+            Transforms.SetLocalPositionNoLerp(moved, msg.Coordinates.Position, transform);
         }
 
         private void OnDraggingPlayerChanged(TabletopDraggingPlayerChangedEvent msg, EntitySessionEventArgs args)
index 262753307f5855d5236890a31b9a3e5e8cbc078a..5ef7619ceb813209e9cca6d630ce71378a8c1d02 100644 (file)
@@ -1,4 +1,4 @@
-using System.Linq;
+using System.Linq;
 using Content.Shared.Ghost;
 using Content.Shared.Movement.Pulling.Components;
 using Content.Shared.Movement.Pulling.Systems;