Turn interaction related attempt events into structs (#29168)
* Turn InteractionAttemptEvent into a struct event * readonly * GettingInteractedWithAttemptEvent * ConsciousAttemptEvent
This commit is contained in:
@@ -11,6 +11,7 @@ using Content.Shared.Throwing;
|
||||
|
||||
namespace Content.Shared.Administration;
|
||||
|
||||
// TODO deduplicate with BlockMovementComponent
|
||||
public abstract class SharedAdminFrozenSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly ActionBlockerSystem _blocker = default!;
|
||||
@@ -23,7 +24,7 @@ public abstract class SharedAdminFrozenSystem : EntitySystem
|
||||
SubscribeLocalEvent<AdminFrozenComponent, UseAttemptEvent>(OnAttempt);
|
||||
SubscribeLocalEvent<AdminFrozenComponent, PickupAttemptEvent>(OnAttempt);
|
||||
SubscribeLocalEvent<AdminFrozenComponent, ThrowAttemptEvent>(OnAttempt);
|
||||
SubscribeLocalEvent<AdminFrozenComponent, InteractionAttemptEvent>(OnAttempt);
|
||||
SubscribeLocalEvent<AdminFrozenComponent, InteractionAttemptEvent>(OnInteractAttempt);
|
||||
SubscribeLocalEvent<AdminFrozenComponent, ComponentStartup>(OnStartup);
|
||||
SubscribeLocalEvent<AdminFrozenComponent, ComponentShutdown>(UpdateCanMove);
|
||||
SubscribeLocalEvent<AdminFrozenComponent, UpdateCanMoveEvent>(OnUpdateCanMove);
|
||||
@@ -34,6 +35,11 @@ public abstract class SharedAdminFrozenSystem : EntitySystem
|
||||
SubscribeLocalEvent<AdminFrozenComponent, SpeakAttemptEvent>(OnSpeakAttempt);
|
||||
}
|
||||
|
||||
private void OnInteractAttempt(Entity<AdminFrozenComponent> ent, ref InteractionAttemptEvent args)
|
||||
{
|
||||
args.Cancelled = true;
|
||||
}
|
||||
|
||||
private void OnSpeakAttempt(EntityUid uid, AdminFrozenComponent component, SpeakAttemptEvent args)
|
||||
{
|
||||
if (!component.Muted)
|
||||
|
||||
Reference in New Issue
Block a user