Makes ghosts able to point through walls. (#2821)
Co-authored-by: BuildTools <unconfigured@null.spigotmc.org>
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
#nullable enable
|
#nullable enable
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using Content.Server.GameObjects.Components.Observer;
|
||||||
using Content.Server.GameObjects.Components.Pointing;
|
using Content.Server.GameObjects.Components.Pointing;
|
||||||
using Content.Server.Players;
|
using Content.Server.Players;
|
||||||
using Content.Shared.GameObjects.EntitySystems;
|
using Content.Shared.GameObjects.EntitySystems;
|
||||||
@@ -79,7 +80,13 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
|
|
||||||
public bool InRange(IEntity pointer, EntityCoordinates coordinates)
|
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)
|
public bool TryPoint(ICommonSession? session, EntityCoordinates coords, EntityUid uid)
|
||||||
|
|||||||
Reference in New Issue
Block a user