diff --git a/Content.Server/Coordinates/Helpers/SnapgridHelper.cs b/Content.Server/Coordinates/Helpers/SnapgridHelper.cs index f643d33227..78fcde94c4 100644 --- a/Content.Server/Coordinates/Helpers/SnapgridHelper.cs +++ b/Content.Server/Coordinates/Helpers/SnapgridHelper.cs @@ -4,13 +4,6 @@ namespace Content.Server.Coordinates.Helpers { public static class SnapgridHelper { - public static void SnapToGrid(this EntityUid entity, IEntityManager? entMan = null, IMapManager? mapManager = null) - { - IoCManager.Resolve(ref entMan, ref mapManager); - var transform = entMan.GetComponent(entity); - transform.Coordinates = transform.Coordinates.SnapToGrid(entMan, mapManager); - } - public static EntityCoordinates SnapToGrid(this EntityCoordinates coordinates, IEntityManager? entMan = null, IMapManager? mapManager = null) { IoCManager.Resolve(ref entMan, ref mapManager); diff --git a/Content.Server/NPC/Pathfinding/PathfindingSystem.Grid.cs b/Content.Server/NPC/Pathfinding/PathfindingSystem.Grid.cs index 6db22c59ab..c5b3d1b3da 100644 --- a/Content.Server/NPC/Pathfinding/PathfindingSystem.Grid.cs +++ b/Content.Server/NPC/Pathfinding/PathfindingSystem.Grid.cs @@ -243,8 +243,10 @@ public sealed partial class PathfindingSystem return; } - var oldGridUid = ev.OldPosition.GetGridUid(EntityManager); - var gridUid = ev.NewPosition.GetGridUid(EntityManager); + var gridUid = ev.Component.GridUid; + var oldGridUid = ev.OldPosition.EntityId == ev.NewPosition.EntityId + ? gridUid + : ev.OldPosition.GetGridUid(EntityManager); // Not on a grid at all so just ignore. if (oldGridUid == gridUid && oldGridUid == null) diff --git a/Content.Shared/Transform/TransformExtensions.cs b/Content.Shared/Transform/TransformExtensions.cs deleted file mode 100644 index 89218c2eab..0000000000 --- a/Content.Shared/Transform/TransformExtensions.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace Content.Shared.Transform -{ - public static class TransformExtensions - { - public static void AttachToGrandparent(this TransformComponent transform) - { - var grandParent = transform.Parent?.Parent; - - if (grandParent == null) - { - transform.AttachToGridOrMap(); - return; - } - - transform.AttachParent(grandParent); - } - - public static void AttachToGrandparent(this EntityUid entity) - { - AttachToGrandparent(IoCManager.Resolve().GetComponent(entity)); - } - } -}