diff --git a/Content.Server/Doors/Systems/DoorSystem.cs b/Content.Server/Doors/Systems/DoorSystem.cs index b4ecee928f..687fc98dd7 100644 --- a/Content.Server/Doors/Systems/DoorSystem.cs +++ b/Content.Server/Doors/Systems/DoorSystem.cs @@ -46,16 +46,6 @@ public sealed class DoorSystem : SharedDoorSystem SubscribeLocalEvent(OnEmagged); } - protected override void OnActivate(EntityUid uid, DoorComponent door, ActivateInWorldEvent args) - { - // TODO once access permissions are shared, move this back to shared. - if (args.Handled || !door.ClickOpen) - return; - - TryToggleDoor(uid, door, args.User); - args.Handled = true; - } - protected override void SetCollidable( EntityUid uid, bool collidable, diff --git a/Content.Shared/Doors/Systems/SharedDoorSystem.cs b/Content.Shared/Doors/Systems/SharedDoorSystem.cs index d607319eb3..850e479ba7 100644 --- a/Content.Shared/Doors/Systems/SharedDoorSystem.cs +++ b/Content.Shared/Doors/Systems/SharedDoorSystem.cs @@ -57,6 +57,7 @@ public abstract class SharedDoorSystem : EntitySystem SubscribeLocalEvent(OnGetState); SubscribeLocalEvent(OnHandleState); + SubscribeLocalEvent(OnInteractedNoHand); SubscribeLocalEvent(OnActivate); SubscribeLocalEvent(HandleCollide); @@ -179,9 +180,22 @@ public abstract class SharedDoorSystem : EntitySystem #endregion #region Interactions - protected virtual void OnActivate(EntityUid uid, DoorComponent door, ActivateInWorldEvent args) + + private void OnInteractedNoHand(EntityUid uid, DoorComponent component, InteractedNoHandEvent args) { - // avoid client-mispredicts, as the server will definitely handle this event + if (args.Handled || !component.ClickOpen || !Tags.HasTag(args.User, "DoorBumpOpener")) + return; + + TryToggleDoor(uid, component, args.User, predicted: true); + args.Handled = true; + } + + public void OnActivate(EntityUid uid, DoorComponent door, ActivateInWorldEvent args) + { + if (args.Handled || !door.ClickOpen) + return; + + TryToggleDoor(uid, door, args.User, predicted: true); args.Handled = true; } diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml b/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml index d90ecfb486..4e2405af7e 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml @@ -2122,9 +2122,9 @@ accent: mouse - type: Tag tags: - - Trash - - CannotSuicide - Hamster + - CannotSuicide + - Trash - type: Respirator damage: types: diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/mimic.yml b/Resources/Prototypes/Entities/Mobs/NPCs/mimic.yml index e763ecac9f..e1390920e3 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/mimic.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/mimic.yml @@ -6,6 +6,7 @@ components: - type: Tag tags: + - DoorBumpOpener - FootstepSound - type: InputMover - type: MobMover diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/slimes.yml b/Resources/Prototypes/Entities/Mobs/NPCs/slimes.yml index a325d557d1..644b373262 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/slimes.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/slimes.yml @@ -41,6 +41,7 @@ volume: 3 - type: Tag tags: + - DoorBumpOpener - FootstepSound - type: Butcherable butcheringType: Knife