diff --git a/Content.Server/Doors/Components/ServerDoorComponent.cs b/Content.Server/Doors/Components/ServerDoorComponent.cs index 7a020c4b0c..589ead48fd 100644 --- a/Content.Server/Doors/Components/ServerDoorComponent.cs +++ b/Content.Server/Doors/Components/ServerDoorComponent.cs @@ -33,7 +33,7 @@ namespace Content.Server.Doors.Components [RegisterComponent] [ComponentReference(typeof(IActivate))] [ComponentReference(typeof(SharedDoorComponent))] - public class ServerDoorComponent : SharedDoorComponent, IActivate, IStartCollide, IInteractUsing, IMapInit + public class ServerDoorComponent : SharedDoorComponent, IActivate, IInteractUsing, IMapInit { [ComponentDependency] private readonly IDoorCheck? _doorCheck = null; @@ -96,7 +96,7 @@ namespace Content.Server.Doors.Components /// Whether the door will open when it is bumped into. /// [ViewVariables(VVAccess.ReadWrite)] [DataField("bumpOpen")] - private bool _bumpOpen = true; + public bool BumpOpen = true; /// /// Whether the door starts open when it's first loaded from prototype. A door won't start open if its prototype is also welded shut. @@ -208,24 +208,6 @@ namespace Content.Server.Doors.Components } } - void IStartCollide.CollideWith(Fixture ourFixture, Fixture otherFixture, in Manifold manifold) - { - if (State != DoorState.Closed) - { - return; - } - - if (!_bumpOpen) - { - return; - } - - // Disabled because it makes it suck hard to walk through double doors. - - TryOpen(otherFixture.Body.Owner); - - } - #region Opening public void TryOpen(IEntity user) diff --git a/Content.Server/Doors/DoorSystem.cs b/Content.Server/Doors/DoorSystem.cs index a35c2056db..286caf371d 100644 --- a/Content.Server/Doors/DoorSystem.cs +++ b/Content.Server/Doors/DoorSystem.cs @@ -1,4 +1,7 @@ +using Content.Server.Doors.Components; using Content.Shared.Doors; +using Robust.Shared.GameObjects; +using Robust.Shared.Physics.Dynamics; namespace Content.Server.Doors { @@ -37,6 +40,24 @@ namespace Content.Server.Doors base.Initialize(); AccessType = AccessTypes.Id; + SubscribeLocalEvent(HandleCollide); + } + + private void HandleCollide(EntityUid uid, ServerDoorComponent component, StartCollideEvent args) + { + if (component.State != SharedDoorComponent.DoorState.Closed) + { + return; + } + + if (!component.BumpOpen) + { + return; + } + + // Disabled because it makes it suck hard to walk through double doors. + + component.TryOpen(args.OtherFixture.Body.Owner); } } }