diff --git a/Content.Server/_DV/Pain/PainSystem.cs b/Content.Server/_DV/Pain/PainSystem.cs index ce4b6711d78..71e2060cafc 100644 --- a/Content.Server/_DV/Pain/PainSystem.cs +++ b/Content.Server/_DV/Pain/PainSystem.cs @@ -1,4 +1,6 @@ using Content.Shared._DV.Pain; +using Content.Shared.Humanoid; +using Content.Shared.Mobs; using Content.Shared.Popups; using Robust.Shared.Prototypes; using Robust.Shared.Random; @@ -17,6 +19,7 @@ public override void Initialize() { base.Initialize(); SubscribeLocalEvent(OnMapInit); + SubscribeLocalEvent(HandlePainDeath); } private void OnMapInit(Entity ent, ref MapInitEvent args) @@ -87,4 +90,10 @@ public override void Update(float frameTime) component.NextUpdateTime = curTime + TimeSpan.FromSeconds(1); } } + + private void HandlePainDeath(Entity ent, ref MobStateChangedEvent args) + { + if (args.NewMobState == MobState.Dead) + EnsureComp(args.Target); + } }