Fix being able to start pulling something while incapacitated. (#4240)
This commit is contained in:
committed by
GitHub
parent
a1088faa35
commit
9bedfe79be
@@ -0,0 +1,22 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user