Skip to content

Commit

Permalink
not working ops
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyndomen committed Jan 10, 2025
1 parent bda5cf7 commit f181001
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions Content.Server/_DV/Pain/PainSystem.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
using Content.Server.Explosion.EntitySystems;
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;
using Robust.Shared.Timing;
using Content.Shared.Mobs;
using Content.Shared.Mobs.Components;

namespace Content.Server._DV.Pain;
Expand All @@ -17,13 +16,11 @@ public sealed class PainSystem : SharedPainSystem
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly SharedPopupSystem _popup = default!;


public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<PainComponent, MapInitEvent>(OnMapInit);
SubscribeLocalEvent<PainComponent, TriggerEvent>(HandlePainTrigger);
SubscribeLocalEvent<PainComponent, MobStateChangedEvent >(HandlePainTrigger);
}

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

private void HandlePainTrigger(EntityUid uid, PainComponent component, TriggerEvent args)
private void HandlePainTrigger(EntityUid uid, PainComponent component, ref MobStateChangedEvent args)
{
if (!TryComp<MobStateComponent>(uid, out var mobstate))
return;

if (mobstate.CurrentState == MobState.Dead)
if (args.NewMobState != MobState.Dead && HasComp<HumanoidAppearanceComponent>(uid))
EnsureComp<PainComponent>(uid);
}
}

0 comments on commit f181001

Please sign in to comment.