Makes ghosts able to point through walls. (#2821)

Co-authored-by: BuildTools <unconfigured@null.spigotmc.org>
This commit is contained in:
Radrark
2020-12-24 10:33:07 -03:00
committed by GitHub
parent b208ff4c20
commit b4506b4d08

View File

@@ -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<GhostComponent>()){
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)