mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* IoC source gen compatibility Can be merged before or after https://github.com/space-wizards/RobustToolbox/pull/6549 doesn't really matter. * Missed a spot
30 lines
958 B
C#
30 lines
958 B
C#
using Content.Server.Administration;
|
|
using Content.Shared.Administration;
|
|
using Robust.Shared.Console;
|
|
|
|
namespace Content.Server.Mind.Commands;
|
|
|
|
[AdminCommand(AdminFlags.Admin)]
|
|
public sealed partial class MakeSentientCommand : LocalizedEntityCommands
|
|
{
|
|
[Dependency] private 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);
|
|
}
|
|
}
|