Fix right-click verbs.
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user