Skip to content

Commit

Permalink
pro
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyndomen committed Jan 10, 2025
1 parent 5968139 commit ba74495
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Content.Server/_DV/Pain/PainSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<PainComponent, MapInitEvent>(OnMapInit);
SubscribeLocalEvent<PainComponent, MobStateChangedEvent>(HandlePainDeath);
SubscribeLocalEvent<HumanoidAppearanceComponent, MobStateChangedEvent>(HandlePainDeath);
}

private void OnMapInit(Entity<PainComponent> ent, ref MapInitEvent args)
Expand Down Expand Up @@ -91,11 +91,9 @@ public override void Update(float frameTime)
}
}

private void HandlePainDeath(EntityUid ent, PainComponent component, ref MobStateChangedEvent args)
private void HandlePainDeath(Entity<HumanoidAppearanceComponent> ent, ref MobStateChangedEvent args)
{
if (args.NewMobState == MobState.Dead && args.OldMobState != MobState.Dead && HasComp<HumanoidAppearanceComponent>(ent))
{
EnsureComp<PainComponent>(ent);
}
if (args.NewMobState == MobState.Dead)
EnsureComp<PainComponent>(args.Target);
}
}

0 comments on commit ba74495

Please sign in to comment.