Allow specific entities to bypass DoAfter delays (#17349)
* Allow specific entities to bypass DoAfter delays This adds the InstantDoAfters tag to the admin ghost for mappers. * Add specific player prototype for InteractionTest
This commit is contained in:
@@ -4,6 +4,7 @@ using Content.Shared.ActionBlocker;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Hands.Components;
|
||||
using Content.Shared.Mobs;
|
||||
using Content.Shared.Tag;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Timing;
|
||||
@@ -16,6 +17,7 @@ public abstract partial class SharedDoAfterSystem : EntitySystem
|
||||
[Dependency] protected readonly IGameTiming GameTiming = default!;
|
||||
[Dependency] private readonly ActionBlockerSystem _actionBlocker = default!;
|
||||
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
||||
[Dependency] private readonly TagSystem _tag = default!;
|
||||
|
||||
/// <summary>
|
||||
/// We'll use an excess time so stuff like finishing effects can show.
|
||||
@@ -221,7 +223,8 @@ public abstract partial class SharedDoAfterSystem : EntitySystem
|
||||
if (args.AttemptFrequency == AttemptFrequency.StartAndEnd && !TryAttemptEvent(doAfter))
|
||||
return false;
|
||||
|
||||
if (args.Delay <= TimeSpan.Zero)
|
||||
if (args.Delay <= TimeSpan.Zero ||
|
||||
_tag.HasTag(args.User, "InstantDoAfters"))
|
||||
{
|
||||
RaiseDoAfterEvents(doAfter, comp);
|
||||
// We don't store instant do-afters. This is just a lazy way of hiding them from client-side visuals.
|
||||
|
||||
Reference in New Issue
Block a user