Remove all but 1 IsIncapacitated (#10661)

This commit is contained in:
metalgearsloth
2022-08-25 23:56:56 +10:00
committed by GitHub
parent 1e9e93a33c
commit 9b84c1a9fd
7 changed files with 69 additions and 50 deletions

View File

@@ -1,5 +1,5 @@
using Content.Client.Pointing.Components;
using Content.Shared.MobState.Components;
using Content.Shared.MobState.EntitySystems;
using Content.Shared.Pointing;
using Content.Shared.Verbs;
using Robust.Client.GameObjects;
@@ -7,8 +7,10 @@ using DrawDepth = Content.Shared.DrawDepth.DrawDepth;
namespace Content.Client.Pointing;
internal sealed class PointingSystem : EntitySystem
public sealed class PointingSystem : EntitySystem
{
[Dependency] private readonly SharedMobStateSystem _mobState = default!;
public override void Initialize()
{
base.Initialize();
@@ -33,7 +35,7 @@ internal sealed class PointingSystem : EntitySystem
// Can the user point? Checking mob state directly instead of some action blocker, as many action blockers are blocked for
// ghosts and there is no obvious choice for pointing (unless ghosts CanEmote?).
if (TryComp(args.User, out MobStateComponent? mob) && mob.IsIncapacitated())
if (_mobState.IsIncapacitated(args.User))
return;
// We won't check in range or visibility, as this verb is currently only executable via the context menu,