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)) if (verb.RequireInteractionRange && !VerbUtility.InVerbUseRange(userEntity, entity))
continue; 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; continue;
}
}
}
var verbData = verb.GetData(userEntity, component); var verbData = verb.GetData(userEntity, component);
if (verbData.IsInvisible) if (verbData.IsInvisible)

View File

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