From 7e5d03a1a8fd22a4ca04a440c09d00c95432ff62 Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Thu, 27 Jul 2023 21:13:17 +0200 Subject: [PATCH] Fix defib "return to body" prompt. (#18376) --- Content.Server/Ghost/ReturnToBodyEui.cs | 5 +++-- Content.Server/Medical/DefibrillatorSystem.cs | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Content.Server/Ghost/ReturnToBodyEui.cs b/Content.Server/Ghost/ReturnToBodyEui.cs index c2d5a96d3f..ff7ba16a01 100644 --- a/Content.Server/Ghost/ReturnToBodyEui.cs +++ b/Content.Server/Ghost/ReturnToBodyEui.cs @@ -8,13 +8,14 @@ namespace Content.Server.Ghost; public sealed class ReturnToBodyEui : BaseEui { - [Dependency] private readonly MindSystem _mindSystem = default!; + private readonly MindSystem _mindSystem; private readonly Mind.Mind _mind; - public ReturnToBodyEui(Mind.Mind mind) + public ReturnToBodyEui(Mind.Mind mind, MindSystem mindSystem) { _mind = mind; + _mindSystem = mindSystem; } public override void HandleMessage(EuiMessageBase msg) diff --git a/Content.Server/Medical/DefibrillatorSystem.cs b/Content.Server/Medical/DefibrillatorSystem.cs index 85cdec5590..5e4e3ca0f2 100644 --- a/Content.Server/Medical/DefibrillatorSystem.cs +++ b/Content.Server/Medical/DefibrillatorSystem.cs @@ -4,6 +4,7 @@ using Content.Server.DoAfter; using Content.Server.Electrocution; using Content.Server.EUI; using Content.Server.Ghost; +using Content.Server.Mind; using Content.Server.Mind.Components; using Content.Server.Popups; using Content.Server.PowerCell; @@ -42,6 +43,7 @@ public sealed class DefibrillatorSystem : EntitySystem [Dependency] private readonly SharedAppearanceSystem _appearance = default!; [Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly UseDelaySystem _useDelay = default!; + [Dependency] private readonly MindSystem _mind = default!; /// public override void Initialize() @@ -231,7 +233,7 @@ public sealed class DefibrillatorSystem : EntitySystem { _chatManager.TrySendInGameICMessage(uid, Loc.GetString("defibrillator-ghosted"), InGameICChatType.Speak, true); - _euiManager.OpenEui(new ReturnToBodyEui(mindComp.Mind), session); + _euiManager.OpenEui(new ReturnToBodyEui(mindComp.Mind, _mind), session); } } else