]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Prevent ghosts from triggering examine artifact triggers (#27249)
authorTayrtahn <tayrtahn@gmail.com>
Mon, 22 Apr 2024 22:46:22 +0000 (18:46 -0400)
committerGitHub <noreply@github.com>
Mon, 22 Apr 2024 22:46:22 +0000 (18:46 -0400)
Content.Server/Xenoarchaeology/XenoArtifacts/Triggers/Systems/ArtifactExamineTriggerSystem.cs

index cbade1682e5d10bec10e791edf83d9bef42539f6..b7afbcfc8b48dfd377b6f9d2440271c44f89eaf4 100644 (file)
@@ -1,5 +1,6 @@
 using Content.Server.Xenoarchaeology.XenoArtifacts.Triggers.Components;
 using Content.Shared.Examine;
+using Content.Shared.Ghost;
 
 namespace Content.Server.Xenoarchaeology.XenoArtifacts.Triggers.Systems;
 
@@ -15,6 +16,10 @@ public sealed class ArtifactExamineTriggerSystem : EntitySystem
 
     private void OnExamine(EntityUid uid, ArtifactExamineTriggerComponent component, ExaminedEvent args)
     {
+        // Prevent ghosts from activating this trigger unless they have CanGhostInteract
+        if (TryComp<GhostComponent>(args.Examiner, out var ghost) && !ghost.CanGhostInteract)
+            return;
+
         _artifact.TryActivateArtifact(uid);
     }
 }