Removal interaction without hands (#8843)

This commit is contained in:
KIBORG04
2022-06-15 08:39:43 +07:00
committed by GitHub
parent 038d534d60
commit a75a921955
9 changed files with 9 additions and 8 deletions

View File

@@ -30,7 +30,7 @@ namespace Content.Server.Construction
private void AddDeconstructVerb(EntityUid uid, ConstructionComponent component, GetVerbsEvent<Verb> args) private void AddDeconstructVerb(EntityUid uid, ConstructionComponent component, GetVerbsEvent<Verb> args)
{ {
if (!args.CanAccess || !args.CanInteract) if (!args.CanAccess || !args.CanInteract || args.Hands == null)
return; return;
if (component.TargetNode == component.DeconstructionNode || if (component.TargetNode == component.DeconstructionNode ||

View File

@@ -30,7 +30,7 @@ namespace Content.Server.Cuffs
private void AddUncuffVerb(EntityUid uid, CuffableComponent component, GetVerbsEvent<Verb> args) private void AddUncuffVerb(EntityUid uid, CuffableComponent component, GetVerbsEvent<Verb> args)
{ {
// Can the user access the cuffs, and is there even anything to uncuff? // Can the user access the cuffs, and is there even anything to uncuff?
if (!args.CanAccess || component.CuffedHandCount == 0) if (!args.CanAccess || component.CuffedHandCount == 0 || args.Hands == null)
return; return;
// We only check can interact if the user is not uncuffing themselves. As a result, the verb will show up // We only check can interact if the user is not uncuffing themselves. As a result, the verb will show up

View File

@@ -18,7 +18,7 @@ namespace Content.Server.Engineering.EntitySystems
} }
private void AddDisassembleVerb(EntityUid uid, DisassembleOnAltVerbComponent component, GetVerbsEvent<AlternativeVerb> args) private void AddDisassembleVerb(EntityUid uid, DisassembleOnAltVerbComponent component, GetVerbsEvent<AlternativeVerb> args)
{ {
if (!args.CanInteract || !args.CanAccess) if (!args.CanInteract || !args.CanAccess || args.Hands == null)
return; return;
AlternativeVerb verb = new() AlternativeVerb verb = new()

View File

@@ -110,7 +110,7 @@ public sealed class SharpSystem : EntitySystem
private void OnGetInteractionVerbs(EntityUid uid, SharedButcherableComponent component, GetVerbsEvent<InteractionVerb> args) private void OnGetInteractionVerbs(EntityUid uid, SharedButcherableComponent component, GetVerbsEvent<InteractionVerb> args)
{ {
if (component.Type != ButcheringType.Knife) if (component.Type != ButcheringType.Knife || args.Hands == null)
return; return;
bool disabled = false; bool disabled = false;

View File

@@ -138,7 +138,7 @@ namespace Content.Server.Medical.SuitSensors
return; return;
// standard interaction checks // standard interaction checks
if (!args.CanAccess || !args.CanInteract) if (!args.CanAccess || !args.CanInteract || args.Hands == null)
return; return;
args.Verbs.UnionWith(new[] args.Verbs.UnionWith(new[]

View File

@@ -41,7 +41,7 @@ public sealed class StickySystem : EntitySystem
private void AddUnstickVerb(EntityUid uid, StickyComponent component, GetVerbsEvent<Verb> args) private void AddUnstickVerb(EntityUid uid, StickyComponent component, GetVerbsEvent<Verb> args)
{ {
if (component.StuckTo == null || !component.CanUnstick || !args.CanInteract) if (component.StuckTo == null || !component.CanUnstick || !args.CanInteract || args.Hands == null)
return; return;
// we can't use args.CanAccess, because it stuck in another container // we can't use args.CanAccess, because it stuck in another container

View File

@@ -50,7 +50,7 @@ public abstract partial class SharedGunSystem
private void OnBallisticVerb(EntityUid uid, BallisticAmmoProviderComponent component, GetVerbsEvent<Verb> args) private void OnBallisticVerb(EntityUid uid, BallisticAmmoProviderComponent component, GetVerbsEvent<Verb> args)
{ {
if (!args.CanAccess || !args.CanInteract) return; if (!args.CanAccess || !args.CanInteract || args.Hands == null) return;
args.Verbs.Add(new Verb() args.Verbs.Add(new Verb()
{ {

View File

@@ -98,7 +98,7 @@ public partial class SharedGunSystem
private void OnRevolverVerbs(EntityUid uid, RevolverAmmoProviderComponent component, GetVerbsEvent<Verb> args) private void OnRevolverVerbs(EntityUid uid, RevolverAmmoProviderComponent component, GetVerbsEvent<Verb> args)
{ {
if (!args.CanAccess || !args.CanInteract) return; if (!args.CanAccess || !args.CanInteract || args.Hands == null) return;
args.Verbs.Add(new Verb() args.Verbs.Add(new Verb()
{ {

View File

@@ -9,6 +9,7 @@
allowSpectator: false # otherwise they can play client-side music allowSpectator: false # otherwise they can play client-side music
inHandsOnly: false inHandsOnly: false
singleUser: true singleUser: true
requireHands: true
verbText: verb-instrument-openui verbText: verb-instrument-openui
key: enum.InstrumentUiKey.Key key: enum.InstrumentUiKey.Key
- type: InteractionOutline - type: InteractionOutline