Defibrillator (#15922)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
32
Content.Server/Ghost/ReturnToBodyEui.cs
Normal file
32
Content.Server/Ghost/ReturnToBodyEui.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using Content.Server.EUI;
|
||||
using Content.Server.Players;
|
||||
using Content.Shared.Eui;
|
||||
using Content.Shared.Ghost;
|
||||
|
||||
namespace Content.Server.Ghost;
|
||||
|
||||
public sealed class ReturnToBodyEui : BaseEui
|
||||
{
|
||||
private readonly Mind.Mind _mind;
|
||||
|
||||
public ReturnToBodyEui(Mind.Mind mind)
|
||||
{
|
||||
_mind = mind;
|
||||
}
|
||||
|
||||
public override void HandleMessage(EuiMessageBase msg)
|
||||
{
|
||||
base.HandleMessage(msg);
|
||||
|
||||
if (msg is not ReturnToBodyMessage choice ||
|
||||
!choice.Accepted)
|
||||
{
|
||||
Close();
|
||||
return;
|
||||
}
|
||||
|
||||
if (_mind.TryGetSession(out var session))
|
||||
session.ContentData()!.Mind?.UnVisit();
|
||||
Close();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user