Files
tbd-station-14/Content.Server/Mind/Commands/MakeSentientCommand.cs
Kyle Tyo 83b3e9e15a Localize makesentient command. Move makesentient method to mind system. (#38565)
* praying pjb doesn't smite me for this 🙏

* requested changes

* Update makesentient-command.ftl

* verin commith and verin taketh away
2025-07-23 14:29:46 +02:00

31 lines
959 B
C#

using Content.Server.Administration;
using Content.Shared.Administration;
using Robust.Shared.Console;
namespace Content.Server.Mind.Commands;
[AdminCommand(AdminFlags.Admin)]
public sealed class MakeSentientCommand : LocalizedEntityCommands
{
[Dependency] private readonly MindSystem _mindSystem = default!;
public override string Command => "makesentient";
public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
if (args.Length != 1)
{
shell.WriteLine(Loc.GetString("shell-need-exactly-one-argument"));
return;
}
if (!NetEntity.TryParse(args[0], out var entNet) || !EntityManager.TryGetEntity(entNet, out var entId) || !EntityManager.EntityExists(entId))
{
shell.WriteLine(Loc.GetString("shell-could-not-find-entity-with-uid", ("uid", args[0])));
return;
}
_mindSystem.MakeSentient(entId.Value);
}
}