]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
MapManager warning cleanup shared edition (#36795)
authorKyle Tyo <36606155+VerinSenpai@users.noreply.github.com>
Wed, 14 May 2025 23:24:44 +0000 (19:24 -0400)
committerGitHub <noreply@github.com>
Wed, 14 May 2025 23:24:44 +0000 (01:24 +0200)
* cleanup and reworking

* one of these days I'll merge a conflict without breaking shit.

* Update Content.Shared/Shuttles/Systems/SharedShuttleSystem.cs

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
* Update Content.Shared/Tabletop/SharedTabletopSystem.cs

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
* I'm gonna send this but... I'll be honest, I dunno what it does.

* fix coordinates

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
Content.Shared/Bed/Cryostorage/SharedCryostorageSystem.cs
Content.Shared/Magic/SharedMagicSystem.cs
Content.Shared/Shuttles/Systems/SharedShuttleSystem.cs
Content.Shared/Tabletop/SharedTabletopSystem.cs

index 450aca0eed6c1000fe2bbd8788484a1eb86763fe..d1066b43e2825c6225d485e6c165de5d0c69b53c 100644 (file)
@@ -7,7 +7,6 @@ using Content.Shared.Mind.Components;
 using Content.Shared.Mobs.Systems;
 using Robust.Shared.Configuration;
 using Robust.Shared.Containers;
-using Robust.Shared.Map;
 using Robust.Shared.Player;
 using Robust.Shared.Timing;
 
index b362b5aa90e45ec23c935832e268cf5b07debade..820b0999a80afb512689a729d0221bb31b1427a1 100644 (file)
@@ -276,13 +276,9 @@ public abstract class SharedMagicSystem : EntitySystem
 
         // If applicable, this ensures the projectile is parented to grid on spawn, instead of the map.
         var fromMap = _transform.ToMapCoordinates(fromCoords);
-        var spawnCoords = _mapManager.TryFindGridAt(fromMap, out var gridUid, out _)
-            ? _transform.WithEntityId(fromCoords, gridUid)
-            : new(_mapManager.GetMapEntityId(fromMap.MapId), fromMap.Position);
-
-        var ent = Spawn(ev.Prototype, spawnCoords);
+        var ent = Spawn(ev.Prototype, fromMap);
         var direction = _transform.ToMapCoordinates(toCoords).Position -
-                         _transform.ToMapCoordinates(spawnCoords).Position;
+                         fromMap.Position;
         _gunSystem.ShootProjectile(ent, direction, userVelocity, ev.Performer, ev.Performer);
     }
     // End Projectile Spells
index b9fc68330e72c416e5baeb6fe43fdb68a5da1829..adea551d2e581a8f02207e93d820126394218788 100644 (file)
@@ -41,7 +41,7 @@ public abstract partial class SharedShuttleSystem : EntitySystem
     /// </summary>
     public bool CanFTLTo(EntityUid shuttleUid, MapId targetMap, EntityUid consoleUid)
     {
-        var mapUid = _mapManager.GetMapEntityId(targetMap);
+        var mapUid = Maps.GetMapOrInvalid(targetMap);
         var shuttleMap = _xformQuery.GetComponent(shuttleUid).MapID;
 
         if (shuttleMap == targetMap)
index 7a2540b11d44266a9fab968853b046db92a4560f..03dd094805c2dd66f4453d6d5f884e8bb8533003 100644 (file)
@@ -5,7 +5,6 @@ using Content.Shared.Hands.Components;
 using Content.Shared.Interaction;
 using Content.Shared.Tabletop.Components;
 using Content.Shared.Tabletop.Events;
-using Robust.Shared.Map;
 using Robust.Shared.Network;
 using Robust.Shared.Serialization;
 
@@ -16,8 +15,8 @@ namespace Content.Shared.Tabletop
         [Dependency] protected readonly ActionBlockerSystem ActionBlockerSystem = default!;
         [Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
         [Dependency] private readonly SharedAppearanceSystem _appearance = default!;
+        [Dependency] private readonly SharedMapSystem _mapSystem = default!;
         [Dependency] protected readonly SharedTransformSystem Transforms = default!;
-        [Dependency] private readonly IMapManager _mapMan = default!;
 
         public override void Initialize()
         {
@@ -41,7 +40,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.SetParent(moved, transform, _mapSystem.GetMapOrInvalid(transform.MapID));
             Transforms.SetLocalPositionNoLerp(moved, msg.Coordinates.Position, transform);
         }