Move static container helper functions to container system (#6382)

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
Leon Friedrich
2022-01-31 20:08:53 +13:00
committed by GitHub
parent af13751600
commit 4614bb9877
9 changed files with 25 additions and 28 deletions

View File

@@ -12,6 +12,7 @@ namespace Content.Shared.Verbs
{
[Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
[Dependency] private readonly ActionBlockerSystem _actionBlockerSystem = default!;
[Dependency] protected readonly SharedContainerSystem ContainerSystem = default!;
public override void Initialize()
{
@@ -53,7 +54,7 @@ namespace Content.Shared.Verbs
canAccess = true;
else if (EntityManager.EntityExists(target) && _interactionSystem.InRangeUnobstructed(user, target, ignoreInsideBlocker: true))
{
if (user.IsInSameOrParentContainer(target))
if (ContainerSystem.IsInSameOrParentContainer(user, target))
canAccess = true;
else
// the item might be in a backpack that the user has open