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:
DrSmugleaf
2020-06-22 18:54:56 +02:00
committed by GitHub
parent 6fe7d11d54
commit ff0f082138
16 changed files with 192 additions and 68 deletions

View File

@@ -1,3 +1,4 @@
using Content.Server.GameObjects.EntitySystems;
using Content.Server.Interfaces;
using Content.Shared.GameObjects;
using Robust.Server.GameObjects;
@@ -37,6 +38,12 @@ namespace Content.Server.GameObjects.Components
{
protected override void GetData(IEntity user, RotatableComponent component, VerbData data)
{
if (!ActionBlockerSystem.CanInteract(user))
{
data.Visibility = VerbVisibility.Invisible;
return;
}
data.CategoryData = VerbCategories.Rotate;
data.Text = "Rotate clockwise";
data.IconTexture = "/Textures/UserInterface/VerbIcons/rotate_cw.svg.96dpi.png";
@@ -53,6 +60,12 @@ namespace Content.Server.GameObjects.Components
{
protected override void GetData(IEntity user, RotatableComponent component, VerbData data)
{
if (!ActionBlockerSystem.CanInteract(user))
{
data.Visibility = VerbVisibility.Invisible;
return;
}
data.CategoryData = VerbCategories.Rotate;
data.Text = "Rotate counter-clockwise";
data.IconTexture = "/Textures/UserInterface/VerbIcons/rotate_ccw.svg.96dpi.png";