From df66584d34bd7f1d8c7ebe3c0140db2035ec6f2a Mon Sep 17 00:00:00 2001 From: Dvir <39403717+dvir001@users.noreply.github.com> Date: Fri, 1 Dec 2023 19:23:19 +0200 Subject: [PATCH] Block artifact activating on protected grid (#624) * Update ArtifactSystem.cs * Update ArtifactSystem.cs --- .../Xenoarchaeology/XenoArtifacts/ArtifactSystem.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactSystem.cs b/Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactSystem.cs index 0791924caaf..5ee7c8f7d96 100644 --- a/Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactSystem.cs +++ b/Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactSystem.cs @@ -7,6 +7,7 @@ using Content.Server.Xenoarchaeology.XenoArtifacts.Events; using Content.Server.Xenoarchaeology.XenoArtifacts.Triggers.Components; using Content.Shared.CCVar; +using Content.Shared.Tiles; using Content.Shared.Xenoarchaeology.XenoArtifacts; using JetBrains.Annotations; using Robust.Shared.Configuration; @@ -149,6 +150,14 @@ public bool TryActivateArtifact(EntityUid uid, EntityUid? user = null, ArtifactC if (component.IsSuppressed) return false; + // Frontier - check if artifact on a protected grid + var xform = Transform(uid); + if (xform.GridUid != null) + { + if (HasComp(xform.GridUid.Value)) + return false; + } + // check if artifact isn't under cooldown var timeDif = _gameTiming.CurTime - component.LastActivationTime; if (timeDif < component.CooldownTime)