Add a tag for immunity from shoe-required step triggers (#10660)

This commit is contained in:
Rane
2022-08-30 02:15:25 -04:00
committed by GitHub
parent fced7e9f11
commit c8d4f81dc1
4 changed files with 16 additions and 0 deletions

View File

@@ -1,12 +1,14 @@
using Content.Shared.Examine;
using Content.Shared.Inventory;
using Content.Shared.StepTrigger.Components;
using Content.Shared.Tag;
namespace Content.Shared.StepTrigger.Systems;
public sealed class ShoesRequiredStepTriggerSystem : EntitySystem
{
[Dependency] private readonly InventorySystem _inventory = default!;
[Dependency] private readonly TagSystem _tagSystem = default!;
/// <inheritdoc/>
public override void Initialize()
@@ -17,6 +19,12 @@ public sealed class ShoesRequiredStepTriggerSystem : EntitySystem
private void OnStepTriggerAttempt(EntityUid uid, ShoesRequiredStepTriggerComponent component, ref StepTriggerAttemptEvent args)
{
if (_tagSystem.HasTag(args.Tripper, "ShoesRequiredStepTriggerImmune"))
{
args.Cancelled = true;
return;
}
if (!TryComp<InventoryComponent>(args.Tripper, out var inventory))
return;