Add a tag for immunity from shoe-required step triggers (#10660)
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user