Ghost toggle FoV action (#12818)

* Ghost toggle FoV action

* p
This commit is contained in:
Kara
2022-11-30 23:46:04 -06:00
committed by GitHub
parent 771e6721eb
commit 01e0ea7922
4 changed files with 45 additions and 12 deletions

View File

@@ -298,7 +298,7 @@ namespace Content.Server.Ghost
return ghostBoo.Handled;
}
}
[AnyCommand]
public sealed class ToggleGhostVisibility : IConsoleCommand
{
@@ -308,10 +308,10 @@ namespace Content.Server.Ghost
public void Execute(IConsoleShell shell, string argStr, string[] args)
{
if (shell.Player == null)
shell.WriteLine("You can only open the ghost roles UI on a client.");
shell.WriteLine("You can only toggle ghost visibility on a client.");
var entityManager = IoCManager.Resolve<IEntityManager>();
var uid = shell.Player?.AttachedEntity;
if (uid == null
|| !entityManager.HasComponent<GhostComponent>(uid)