]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Ghosts can now always see examine details (#29404)
authorPieter-Jan Briers <pieterjan.briers+git@gmail.com>
Mon, 24 Jun 2024 15:36:52 +0000 (17:36 +0200)
committerGitHub <noreply@github.com>
Mon, 24 Jun 2024 15:36:52 +0000 (17:36 +0200)
* Ghosts can now always see examine details

This means they bypass range and occlusion checks for getting extra detail, like the charge on an SMES.

* EntityQuery

Content.Shared/Examine/ExamineSystemShared.Group.cs
Content.Shared/Examine/ExamineSystemShared.cs

index bd284f321c8e67340dbe383b58489b444e3d1110..22aeeeeab873fa55f95d1835e14cfb7ec62d2bd7 100644 (file)
@@ -1,3 +1,4 @@
+using Content.Shared.Ghost;
 using Content.Shared.Verbs;
 using Robust.Shared.Utility;
 
@@ -14,6 +15,8 @@ namespace Content.Shared.Examine
             base.Initialize();
 
             SubscribeLocalEvent<GroupExamineComponent, GetVerbsEvent<ExamineVerb>>(OnGroupExamineVerb);
+
+            _ghostQuery = GetEntityQuery<GhostComponent>();
         }
 
         /// <summary>
index 8831213c352474c27d3012325c7965d268a5ee0b..4100b07483fc7e10c54908d320fc1ea20417f2bf 100644 (file)
@@ -3,6 +3,7 @@ using System.Globalization;
 using System.Linq;
 using System.Text;
 using Content.Shared.Eye.Blinding.Components;
+using Content.Shared.Ghost;
 using Content.Shared.Interaction;
 using Content.Shared.Mobs.Components;
 using Content.Shared.Mobs.Systems;
@@ -44,6 +45,8 @@ namespace Content.Shared.Examine
 
         protected const float ExamineBlurrinessMult = 2.5f;
 
+        private EntityQuery<GhostComponent> _ghostQuery;
+
         /// <summary>
         ///     Creates a new examine tooltip with arbitrary info.
         /// </summary>
@@ -54,6 +57,10 @@ namespace Content.Shared.Examine
             if (IsClientSide(entity))
                 return true;
 
+            // Ghosts can see everything.
+            if (_ghostQuery.HasComp(examiner))
+                return true;
+
             // check if the mob is in critical or dead
             if (MobStateSystem.IsIncapacitated(examiner))
                 return false;