From 066af633237a4b5e40e982a942e200e91d9c1363 Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Wed, 8 Jul 2020 16:10:46 +0200 Subject: [PATCH] Fix not being able to buckle into an entity that is in the same container as you --- .../GameObjects/Components/Mobs/BuckleComponent.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs b/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs index 82d9f809d4..e8733b095b 100644 --- a/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs +++ b/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs @@ -142,10 +142,15 @@ namespace Content.Server.GameObjects.Components.Mobs return false; } - if (ContainerHelpers.IsInContainer(Owner)) + if (ContainerHelpers.TryGetContainer(Owner, out var ownerContainer)) { - _notifyManager.PopupMessage(strap.Owner, user, - Loc.GetString("You can't reach there!")); + if (!ContainerHelpers.TryGetContainer(strap.Owner, out var strapContainer) || + ownerContainer != strapContainer) + { + _notifyManager.PopupMessage(strap.Owner, user, + Loc.GetString("You can't reach there!")); + return false; + } } if (!user.HasComponent())