diff --git a/Content.Server/GameObjects/Components/Disposal/DisposalTubeComponent.cs b/Content.Server/GameObjects/Components/Disposal/DisposalTubeComponent.cs index 94dccce0a7..3326b4fd0e 100644 --- a/Content.Server/GameObjects/Components/Disposal/DisposalTubeComponent.cs +++ b/Content.Server/GameObjects/Components/Disposal/DisposalTubeComponent.cs @@ -69,21 +69,11 @@ namespace Content.Server.GameObjects.Components.Disposal { var nextDirection = NextDirection(holder); var snapGrid = Owner.GetComponent(); + var oppositeDirection = new Angle(nextDirection.ToAngle().Theta + Math.PI).GetDir(); var tube = snapGrid .GetInDir(nextDirection) .Select(x => x.TryGetComponent(out IDisposalTubeComponent? c) ? c : null) - .FirstOrDefault(x => x != null && x != this); - - if (tube == null) - { - return null; - } - - var oppositeDirection = new Angle(nextDirection.ToAngle().Theta + Math.PI).GetDir(); - if (!tube.CanConnect(oppositeDirection, this)) - { - return null; - } + .FirstOrDefault(x => x != null && x != this && x.CanConnect(oppositeDirection, this)); return tube; }