From b4506b4d0819e873c061a05bd2d3d653681ba55d Mon Sep 17 00:00:00 2001 From: Radrark <76271993+Radrark@users.noreply.github.com> Date: Thu, 24 Dec 2020 10:33:07 -0300 Subject: [PATCH] Makes ghosts able to point through walls. (#2821) Co-authored-by: BuildTools --- .../GameObjects/EntitySystems/PointingSystem.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Content.Server/GameObjects/EntitySystems/PointingSystem.cs b/Content.Server/GameObjects/EntitySystems/PointingSystem.cs index 016d92312e..0569600e7b 100644 --- a/Content.Server/GameObjects/EntitySystems/PointingSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/PointingSystem.cs @@ -1,6 +1,7 @@ -#nullable enable +#nullable enable using System; using System.Collections.Generic; +using Content.Server.GameObjects.Components.Observer; using Content.Server.GameObjects.Components.Pointing; using Content.Server.Players; using Content.Shared.GameObjects.EntitySystems; @@ -79,7 +80,13 @@ namespace Content.Server.GameObjects.EntitySystems public bool InRange(IEntity pointer, EntityCoordinates coordinates) { - return pointer.InRangeUnOccluded(coordinates, 15, e => e == pointer); + if (pointer.HasComponent()){ + return pointer.Transform.Coordinates.InRange(EntityManager, coordinates, 15); + } + else + { + return pointer.InRangeUnOccluded(coordinates, 15, e => e == pointer); + } } public bool TryPoint(ICommonSession? session, EntityCoordinates coords, EntityUid uid)