Fix being able to use invalid verbs as a ghost (#1157)
* Add CanInteract check to 18 verbs * Add more caninteract checks to verbs without it Storage toggle open, ammo box dump, bolt open and close, revolver spin and magazine open and close
This commit is contained in:
@@ -338,8 +338,13 @@ namespace Content.Server.GameObjects.Components
|
||||
{
|
||||
protected override void GetData(IEntity user, EntityStorageComponent component, VerbData data)
|
||||
{
|
||||
component.OpenVerbGetData(user, component, data);
|
||||
if (!ActionBlockerSystem.CanInteract(user))
|
||||
{
|
||||
data.Visibility = VerbVisibility.Invisible;
|
||||
return;
|
||||
}
|
||||
|
||||
component.OpenVerbGetData(user, component, data);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -351,6 +356,12 @@ namespace Content.Server.GameObjects.Components
|
||||
|
||||
protected virtual void OpenVerbGetData(IEntity user, EntityStorageComponent component, VerbData data)
|
||||
{
|
||||
if (!ActionBlockerSystem.CanInteract(user))
|
||||
{
|
||||
data.Visibility = VerbVisibility.Invisible;
|
||||
return;
|
||||
}
|
||||
|
||||
if (IsWeldedShut)
|
||||
{
|
||||
data.Visibility = VerbVisibility.Disabled;
|
||||
|
||||
@@ -116,7 +116,9 @@ namespace Content.Server.GameObjects
|
||||
{
|
||||
protected override void GetData(IEntity user, ItemComponent component, VerbData data)
|
||||
{
|
||||
if (ContainerHelpers.IsInContainer(component.Owner) || !component.CanPickup(user))
|
||||
if (!ActionBlockerSystem.CanInteract(user) ||
|
||||
ContainerHelpers.IsInContainer(component.Owner) ||
|
||||
!component.CanPickup(user))
|
||||
{
|
||||
data.Visibility = VerbVisibility.Invisible;
|
||||
return;
|
||||
|
||||
@@ -139,7 +139,7 @@ namespace Content.Server.GameObjects.Components.Items.Storage
|
||||
{
|
||||
protected override void GetData(IEntity user, SecureEntityStorageComponent component, VerbData data)
|
||||
{
|
||||
if (component.Open)
|
||||
if (!ActionBlockerSystem.CanInteract(user) || component.Open)
|
||||
{
|
||||
data.Visibility = VerbVisibility.Invisible;
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user