diff --git a/Content.Server/Medical/DefibrillatorSystem.cs b/Content.Server/Medical/DefibrillatorSystem.cs index 983805e793..06a4e93736 100644 --- a/Content.Server/Medical/DefibrillatorSystem.cs +++ b/Content.Server/Medical/DefibrillatorSystem.cs @@ -29,7 +29,6 @@ namespace Content.Server.Medical; public sealed class DefibrillatorSystem : EntitySystem { [Dependency] private readonly IGameTiming _timing = default!; - [Dependency] private readonly IPlayerManager _playerManager = default!; [Dependency] private readonly ChatSystem _chatManager = default!; [Dependency] private readonly DamageableSystem _damageable = default!; [Dependency] private readonly DoAfterSystem _doAfter = default!; @@ -217,17 +216,16 @@ public sealed class DefibrillatorSystem : EntitySystem } else { + _mobThreshold.SetAllowRevives(target, true, thresholds); if (_mobState.IsDead(target, mob)) _damageable.TryChangeDamage(target, component.ZapHeal, true, origin: uid); - - _mobThreshold.SetAllowRevives(target, true, thresholds); _mobState.ChangeMobState(target, MobState.Critical, mob, uid); _mobThreshold.SetAllowRevives(target, false, thresholds); if (TryComp(target, out var mindComp) && - mindComp.Mind?.UserId != null && - _playerManager.TryGetSessionById(mindComp.Mind.UserId.Value, out session)) + mindComp.Mind?.Session is { } playerSession) { + session = playerSession; // notify them they're being revived. if (mindComp.Mind.CurrentEntity != target) { diff --git a/Content.Shared/Mobs/Systems/MobThresholdSystem.cs b/Content.Shared/Mobs/Systems/MobThresholdSystem.cs index d421be8847..c8672464ce 100644 --- a/Content.Shared/Mobs/Systems/MobThresholdSystem.cs +++ b/Content.Shared/Mobs/Systems/MobThresholdSystem.cs @@ -289,6 +289,7 @@ public sealed class MobThresholdSystem : EntitySystem return; component.AllowRevives = val; Dirty(component); + VerifyThresholds(uid, component); } #endregion