diff --git a/Content.Server/Ghost/GhostSystem.cs b/Content.Server/Ghost/GhostSystem.cs index d353364645..5b4da33782 100644 --- a/Content.Server/Ghost/GhostSystem.cs +++ b/Content.Server/Ghost/GhostSystem.cs @@ -46,6 +46,7 @@ namespace Content.Server.Ghost SubscribeLocalEvent(OnMindRemovedMessage); SubscribeLocalEvent(OnMindUnvisitedMessage); + SubscribeLocalEvent(OnPlayerDetached); SubscribeLocalEvent(OnRelayMoveInput); @@ -58,6 +59,7 @@ namespace Content.Server.Ghost SubscribeLocalEvent(_ => MakeVisible(true)); } + private void OnActionPerform(EntityUid uid, GhostComponent component, BooActionEvent args) { if (args.Handled) @@ -160,6 +162,11 @@ namespace Content.Server.Ghost DeleteEntity(uid); } + private void OnPlayerDetached(EntityUid uid, GhostComponent component, PlayerDetachedEvent args) + { + QueueDel(uid); + } + private void OnGhostWarpsRequest(GhostWarpsRequestEvent msg, EntitySessionEventArgs args) { if (args.SenderSession.AttachedEntity is not {Valid: true} entity ||