CatStation/Content.Server/Mind/Commands/MakeSentientCommand.cs
Pieter-Jan Briers 5168b5f3d4
IoC source gen compatibility (#43863)
* 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
2026-05-09 03:29:58 +00:00

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);
}
}