Mind ecs (#14412)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using Content.Server.Mind;
|
||||
using Content.Server.Mind.Components;
|
||||
using Content.Server.Players;
|
||||
using Content.Shared.Administration;
|
||||
@@ -9,9 +10,10 @@ namespace Content.Server.Administration.Commands
|
||||
[AdminCommand(AdminFlags.Admin)]
|
||||
sealed class SetMindCommand : IConsoleCommand
|
||||
{
|
||||
|
||||
public string Command => "setmind";
|
||||
|
||||
public string Description => Loc.GetString("set-mind-command-description", ("requiredComponent", nameof(MindComponent)));
|
||||
public string Description => Loc.GetString("set-mind-command-description", ("requiredComponent", nameof(MindContainerComponent)));
|
||||
|
||||
public string Help => Loc.GetString("set-mind-command-help-text", ("command", Command));
|
||||
|
||||
@@ -39,7 +41,7 @@ namespace Content.Server.Administration.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
if (!entityManager.HasComponent<MindComponent>(eUid))
|
||||
if (!entityManager.HasComponent<MindContainerComponent>(eUid))
|
||||
{
|
||||
shell.WriteLine(Loc.GetString("set-mind-command-target-has-no-mind-message"));
|
||||
return;
|
||||
@@ -59,16 +61,16 @@ namespace Content.Server.Administration.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
var mindSystem = entityManager.System<MindSystem>();
|
||||
|
||||
var mind = playerCData.Mind;
|
||||
if (mind == null)
|
||||
{
|
||||
mind = new Mind.Mind(session.UserId)
|
||||
{
|
||||
CharacterName = entityManager.GetComponent<MetaDataComponent>(eUid).EntityName
|
||||
};
|
||||
mind.ChangeOwningPlayer(session.UserId);
|
||||
mind = mindSystem.CreateMind(session.UserId);
|
||||
mind.CharacterName = entityManager.GetComponent<MetaDataComponent>(eUid).EntityName;
|
||||
}
|
||||
mind.TransferTo(eUid);
|
||||
|
||||
mindSystem.TransferTo(mind, eUid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user