From: Pieter-Jan Briers Date: Mon, 24 Jun 2024 15:36:52 +0000 (+0200) Subject: Ghosts can now always see examine details (#29404) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=e7bcb270e4c7278ce7c5b72c52ff1b720dc97823;p=space-station-14.git Ghosts can now always see examine details (#29404) * 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 --- diff --git a/Content.Shared/Examine/ExamineSystemShared.Group.cs b/Content.Shared/Examine/ExamineSystemShared.Group.cs index bd284f321c..22aeeeeab8 100644 --- a/Content.Shared/Examine/ExamineSystemShared.Group.cs +++ b/Content.Shared/Examine/ExamineSystemShared.Group.cs @@ -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>(OnGroupExamineVerb); + + _ghostQuery = GetEntityQuery(); } /// diff --git a/Content.Shared/Examine/ExamineSystemShared.cs b/Content.Shared/Examine/ExamineSystemShared.cs index 8831213c35..4100b07483 100644 --- a/Content.Shared/Examine/ExamineSystemShared.cs +++ b/Content.Shared/Examine/ExamineSystemShared.cs @@ -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 _ghostQuery; + /// /// Creates a new examine tooltip with arbitrary info. /// @@ -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;