Minor cuff changes (#4164)

This commit is contained in:
metalgearsloth
2021-06-17 00:37:05 +10:00
committed by GitHub
parent 40b86903b3
commit 7cbfbad578
6 changed files with 52 additions and 5 deletions

View File

@@ -0,0 +1,25 @@
using Content.Shared.Cuffs.Components;
using Content.Shared.Pulling.Components;
using Robust.Shared.GameObjects;
namespace Content.Shared.Cuffs
{
public abstract class SharedCuffableSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<SharedCuffableComponent, StopPullingEvent>(HandleStopPull);
}
private void HandleStopPull(EntityUid uid, SharedCuffableComponent component, StopPullingEvent args)
{
if (args.User == null || !EntityManager.TryGetEntity(args.User.Value, out var user)) return;
if (user == component.Owner && !component.CanStillInteract)
{
args.Cancel();
}
}
}
}