Skip to content

Commit

Permalink
Block artifact activating on protected grid (#624)
Browse files Browse the repository at this point in the history
* Update ArtifactSystem.cs

* Update ArtifactSystem.cs
  • Loading branch information
dvir001 committed Dec 1, 2023
1 parent 0f77199 commit df66584
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<ProtectedGridComponent>(xform.GridUid.Value))
return false;
}

// check if artifact isn't under cooldown
var timeDif = _gameTiming.CurTime - component.LastActivationTime;
if (timeDif < component.CooldownTime)
Expand Down

0 comments on commit df66584

Please sign in to comment.