Fix not being able to buckle into an entity that is in the same container as you

This commit is contained in:
DrSmugleaf
2020-07-08 16:10:46 +02:00
parent 4ec733577f
commit 066af63323

View File

@@ -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<HandsComponent>())