Files
tbd-station-14/Content.Shared/MobState/EntitySystems/SharedMobStateSystem.cs

23 lines
639 B
C#

using Content.Shared.MobState.Components;
using Content.Shared.Pulling.Events;
using Robust.Shared.GameObjects;
namespace Content.Shared.MobState.EntitySystems
{
public class SharedMobStateSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<SharedMobStateComponent, StartPullAttemptEvent>(OnStartPullAttempt);
}
private void OnStartPullAttempt(EntityUid uid, SharedMobStateComponent component, StartPullAttemptEvent args)
{
if(component.IsIncapacitated())
args.Cancel();
}
}
}