Ignore player ent for popup raycasts (#13485)

This commit is contained in:
metalgearsloth
2023-01-16 05:14:21 +11:00
committed by GitHub
parent 78deed3925
commit 67ecae6b7d
2 changed files with 7 additions and 2 deletions

View File

@@ -4,6 +4,7 @@ using Content.Shared.Examine;
using Content.Shared.Interaction;
using Content.Shared.Popups;
using Robust.Client.Graphics;
using Robust.Client.Player;
using Robust.Client.ResourceManagement;
using Robust.Client.UserInterface;
using Robust.Shared;
@@ -21,6 +22,7 @@ public sealed class PopupOverlay : Overlay
{
private readonly IConfigurationManager _configManager;
private readonly IEntityManager _entManager;
private readonly IPlayerManager _playerMgr;
private readonly IUserInterfaceManager _uiManager;
private readonly PopupSystem _popup;
@@ -34,6 +36,7 @@ public sealed class PopupOverlay : Overlay
public PopupOverlay(
IConfigurationManager configManager,
IEntityManager entManager,
IPlayerManager playerMgr,
IPrototypeManager protoManager,
IResourceCache cache,
IUserInterfaceManager uiManager,
@@ -41,6 +44,7 @@ public sealed class PopupOverlay : Overlay
{
_configManager = configManager;
_entManager = entManager;
_playerMgr = playerMgr;
_uiManager = uiManager;
_popup = popup;
@@ -75,6 +79,7 @@ public sealed class PopupOverlay : Overlay
var matrix = args.ViewportControl!.GetWorldToScreenMatrix();
var viewPos = new MapCoordinates(args.WorldAABB.Center, args.MapId);
var ourEntity = _playerMgr.LocalPlayer?.ControlledEntity;
foreach (var popup in _popup.WorldLabels)
{
@@ -87,7 +92,7 @@ public sealed class PopupOverlay : Overlay
// Should handle fade here too wyci.
if (!args.WorldAABB.Contains(mapPos.Position) || !ExamineSystemShared.InRangeUnOccluded(viewPos, mapPos, distance,
e => e == popup.InitialPos.EntityId, entMan: _entManager))
e => e == popup.InitialPos.EntityId || e == ourEntity, entMan: _entManager))
continue;
var pos = matrix.Transform(mapPos.Position);

View File

@@ -39,7 +39,7 @@ namespace Content.Client.Popups
SubscribeNetworkEvent<PopupEntityEvent>(OnPopupEntityEvent);
SubscribeNetworkEvent<RoundRestartCleanupEvent>(OnRoundRestart);
_overlay
.AddOverlay(new PopupOverlay(_configManager, EntityManager, _prototype, _resource, _uiManager, this));
.AddOverlay(new PopupOverlay(_configManager, EntityManager, _playerManager, _prototype, _resource, _uiManager, this));
}
public override void Shutdown()