Skip to content

Commit

Permalink
add(SharedDoAfterSystem): Add a IsRunning "Utility" function (space-w…
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon-Huu authored Jul 31, 2024
1 parent 778bfe3 commit 5bc9c04
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Content.Shared/DoAfter/SharedDoAfterSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -393,5 +393,18 @@ public DoAfterStatus GetStatus(EntityUid entity, ushort id, DoAfterComponent? co
// networking whether a do-after has raised its events or not.
return DoAfterStatus.Finished;
}

public bool IsRunning(DoAfterId? id, DoAfterComponent? comp = null)
{
if (id == null)
return false;

return GetStatus(id.Value.Uid, id.Value.Index, comp) == DoAfterStatus.Running;
}

public bool IsRunning(EntityUid entity, ushort id, DoAfterComponent? comp = null)
{
return GetStatus(entity, id, comp) == DoAfterStatus.Running;
}
#endregion
}

0 comments on commit 5bc9c04

Please sign in to comment.