From d7685512bb18e606712e24949d5ee1c4024cd0cc Mon Sep 17 00:00:00 2001 From: 20kdc Date: Tue, 24 Nov 2020 12:23:49 +0000 Subject: [PATCH] InteractionSystem: Fix exception when clicking around off-grid (GridCoordinates/default grid leftovers?) (#2624) --- .../GameObjects/EntitySystems/Click/InteractionSystem.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs b/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs index 0740a7caeb..c1ecd0d991 100644 --- a/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs @@ -36,7 +36,6 @@ namespace Content.Server.GameObjects.EntitySystems.Click [UsedImplicitly] public sealed class InteractionSystem : SharedInteractionSystem { - [Dependency] private readonly IMapManager _mapManager = default!; [Dependency] private readonly IEntityManager _entityManager = default!; public override void Initialize() @@ -805,7 +804,7 @@ namespace Content.Server.GameObjects.EntitySystems.Click private void DoAttack(IEntity player, EntityCoordinates coordinates, bool wideAttack, EntityUid target = default) { // Verify player is on the same map as the entity he clicked on - if (_mapManager.GetGrid(coordinates.GetGridId(EntityManager)).ParentMapId != player.Transform.MapID) + if (coordinates.GetMapId(EntityManager) != player.Transform.MapID) { Logger.WarningS("system.interaction", $"Player named {player.Name} clicked on a map he isn't located on");