2021-01-10 20:07:54 +01:00
|
|
|
using Content.Server.Administration;
|
|
|
|
|
using Content.Shared.Administration;
|
2021-02-01 16:49:43 -08:00
|
|
|
using Robust.Shared.Console;
|
2021-01-10 20:07:54 +01:00
|
|
|
|
2025-07-23 08:29:46 -04:00
|
|
|
namespace Content.Server.Mind.Commands;
|
|
|
|
|
|
|
|
|
|
[AdminCommand(AdminFlags.Admin)]
|
|
|
|
|
public sealed class MakeSentientCommand : LocalizedEntityCommands
|
2021-01-10 20:07:54 +01:00
|
|
|
{
|
2025-07-23 08:29:46 -04:00
|
|
|
[Dependency] private readonly MindSystem _mindSystem = default!;
|
2023-09-11 09:42:41 +10:00
|
|
|
|
2025-07-23 08:29:46 -04:00
|
|
|
public override string Command => "makesentient";
|
2021-01-10 20:07:54 +01:00
|
|
|
|
2025-07-23 08:29:46 -04:00
|
|
|
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
|
|
|
|
{
|
|
|
|
|
if (args.Length != 1)
|
2021-01-10 20:07:54 +01:00
|
|
|
{
|
2025-07-23 08:29:46 -04:00
|
|
|
shell.WriteLine(Loc.GetString("shell-need-exactly-one-argument"));
|
|
|
|
|
return;
|
2021-02-14 13:34:02 +01:00
|
|
|
}
|
|
|
|
|
|
2025-07-23 08:29:46 -04:00
|
|
|
if (!NetEntity.TryParse(args[0], out var entNet) || !EntityManager.TryGetEntity(entNet, out var entId) || !EntityManager.EntityExists(entId))
|
2021-02-14 13:34:02 +01:00
|
|
|
{
|
2025-07-23 08:29:46 -04:00
|
|
|
shell.WriteLine(Loc.GetString("shell-could-not-find-entity-with-uid", ("uid", args[0])));
|
|
|
|
|
return;
|
2021-01-10 20:07:54 +01:00
|
|
|
}
|
2025-07-23 08:29:46 -04:00
|
|
|
|
|
|
|
|
_mindSystem.MakeSentient(entId.Value);
|
2021-01-10 20:07:54 +01:00
|
|
|
}
|
|
|
|
|
}
|