Skip to content

Commit

Permalink
fucked if i know
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyndomen committed Jan 10, 2025
1 parent 17993bc commit 5968139
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 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 >(HandlePainTrigger);
SubscribeLocalEvent<PainComponent, MobStateChangedEvent>(HandlePainDeath);
}

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

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

0 comments on commit 5968139

Please sign in to comment.