Fix right-click verbs.

This commit is contained in:
Pieter-Jan Briers
2020-08-16 23:49:20 +02:00
parent 12d94f28a1
commit 58b9ac10c2
2 changed files with 12 additions and 2 deletions

View File

@@ -113,8 +113,17 @@ namespace Content.Server.GameObjects.EntitySystems
if (verb.RequireInteractionRange && !VerbUtility.InVerbUseRange(userEntity, entity))
continue;
if (verb.BlockedByContainers && !userEntity.IsInSameOrNoContainer(entity))
if (verb.BlockedByContainers)
{
if (!userEntity.IsInSameOrNoContainer(entity))
{
if (!ContainerHelpers.TryGetContainer(entity, out var container) ||
container.Owner != userEntity)
{
continue;
}
}
}
var verbData = verb.GetData(userEntity, component);
if (verbData.IsInvisible)

View File

@@ -23,6 +23,7 @@ namespace Content.Shared.GameObjects.Verbs
/// <summary>
/// If true, this verb requires both the user and the entity on which
/// this verb resides to be in the same container or no container.
/// OR the user can be the entity's container
/// </summary>
public virtual bool BlockedByContainers => true;