using Content.Shared.Input;
using Content.Shared.Interaction;
using Content.Shared.Item;
+using Content.Shared.Mobs;
+using Content.Shared.Mobs.Systems;
using Content.Shared.Movement.Events;
using Content.Shared.Movement.Pulling.Components;
using Content.Shared.Movement.Pulling.Events;
SubscribeLocalEvent<PullableComponent, ModifyUncuffDurationEvent>(OnModifyUncuffDuration);
SubscribeLocalEvent<PullableComponent, StopBeingPulledAlertEvent>(OnStopBeingPulledAlert);
+ SubscribeLocalEvent<PullerComponent, UpdateMobStateEvent>(OnStateChanged);
SubscribeLocalEvent<PullerComponent, AfterAutoHandleStateEvent>(OnAfterState);
SubscribeLocalEvent<PullerComponent, EntGotInsertedIntoContainerMessage>(OnPullerContainerInsert);
SubscribeLocalEvent<PullerComponent, EntityUnpausedEvent>(OnPullerUnpaused);
.Register<PullingSystem>();
}
+ private void OnStateChanged(EntityUid uid, PullerComponent component, ref UpdateMobStateEvent args)
+ {
+ if (component.Pulling == null)
+ return;
+
+ if (TryComp<PullableComponent>(component.Pulling, out var comp) && (args.State == MobState.Critical || args.State == MobState.Dead))
+ {
+ TryStopPull(component.Pulling.Value, comp);
+ }
+ }
+
private void OnBuckled(Entity<PullableComponent> ent, ref StrappedEvent args)
{
// Prevent people from pulling the entity they are buckled to