From ba744958a4aad2a86c6ec57badea8f6dc1131ecb Mon Sep 17 00:00:00 2001 From: Lyndomen <49795619+Lyndomen@users.noreply.github.com> Date: Fri, 10 Jan 2025 17:14:46 -0500 Subject: [PATCH] pro --- Content.Server/_DV/Pain/PainSystem.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Content.Server/_DV/Pain/PainSystem.cs b/Content.Server/_DV/Pain/PainSystem.cs index 7beb917d4b3..71e2060cafc 100644 --- a/Content.Server/_DV/Pain/PainSystem.cs +++ b/Content.Server/_DV/Pain/PainSystem.cs @@ -19,7 +19,7 @@ public override void Initialize() { base.Initialize(); SubscribeLocalEvent(OnMapInit); - SubscribeLocalEvent(HandlePainDeath); + SubscribeLocalEvent(HandlePainDeath); } private void OnMapInit(Entity ent, ref MapInitEvent args) @@ -91,11 +91,9 @@ public override void Update(float frameTime) } } - private void HandlePainDeath(EntityUid ent, PainComponent component, ref MobStateChangedEvent args) + private void HandlePainDeath(Entity ent, ref MobStateChangedEvent args) { - if (args.NewMobState == MobState.Dead && args.OldMobState != MobState.Dead && HasComp(ent)) - { - EnsureComp(ent); - } + if (args.NewMobState == MobState.Dead) + EnsureComp(args.Target); } }