Show ghosts popups etc through walls (#8077)

* Show ghosts popups etc through walls

* Stage moment

* crashes
This commit is contained in:
metalgearsloth
2022-05-12 21:18:38 +10:00
committed by GitHub
parent 40361ec0ad
commit 6903209a31
4 changed files with 25 additions and 14 deletions

View File

@@ -20,6 +20,7 @@ namespace Content.Client.Popups
[Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!;
[Dependency] private readonly IEyeManager _eyeManager = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly ExamineSystemShared _examineSystem = default!;
private readonly List<PopupLabel> _aliveLabels = new();
@@ -141,6 +142,7 @@ namespace Content.Client.Popups
// ReSharper disable once ConvertToLocalFunction
var predicate = static (EntityUid uid, (EntityUid? compOwner, EntityUid? attachedEntity) data)
=> uid == data.compOwner || uid == data.attachedEntity;
var occluded = player != null && _examineSystem.IsOccluded(player.Value);
for (var i = _aliveLabels.Count - 1; i >= 0; i--)
{
@@ -161,7 +163,7 @@ namespace Content.Client.Popups
var otherPos = label.Entity != null ? Transform(label.Entity.Value).MapPosition : label.InitialPos;
if (!ExamineSystemShared.InRangeUnOccluded(
if (occluded && !ExamineSystemShared.InRangeUnOccluded(
playerPos,
otherPos, 0f,
(label.Entity, player), predicate))