Prevent ghosts from triggering examine artifact triggers (#27249)

This commit is contained in:
Tayrtahn
2024-04-22 18:46:22 -04:00
committed by GitHub
parent 5b0c3ecf73
commit 8eecd9cc2d

View 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);
}
}