Fix defib "return to body" prompt. (#18376)

This commit is contained in:
Pieter-Jan Briers
2023-07-27 21:13:17 +02:00
committed by GitHub
parent 1d1918f034
commit 7e5d03a1a8
2 changed files with 6 additions and 3 deletions

View File

@@ -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)

View File

@@ -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!;
/// <inheritdoc/>
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