Fix setmind command (#18799)
This commit is contained in:
@@ -19,7 +19,7 @@ namespace Content.Server.Administration.Commands
|
|||||||
|
|
||||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||||
{
|
{
|
||||||
if (args.Length != 2)
|
if (args.Length < 2)
|
||||||
{
|
{
|
||||||
shell.WriteLine(Loc.GetString("shell-wrong-arguments-number"));
|
shell.WriteLine(Loc.GetString("shell-wrong-arguments-number"));
|
||||||
return;
|
return;
|
||||||
@@ -31,6 +31,12 @@ namespace Content.Server.Administration.Commands
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ghostOverride = true;
|
||||||
|
if (args.Length > 2)
|
||||||
|
{
|
||||||
|
ghostOverride = bool.Parse(args[2]);
|
||||||
|
}
|
||||||
|
|
||||||
var entityManager = IoCManager.Resolve<IEntityManager>();
|
var entityManager = IoCManager.Resolve<IEntityManager>();
|
||||||
|
|
||||||
var eUid = new EntityUid(entityUid);
|
var eUid = new EntityUid(entityUid);
|
||||||
@@ -70,7 +76,7 @@ namespace Content.Server.Administration.Commands
|
|||||||
mind.CharacterName = entityManager.GetComponent<MetaDataComponent>(eUid).EntityName;
|
mind.CharacterName = entityManager.GetComponent<MetaDataComponent>(eUid).EntityName;
|
||||||
}
|
}
|
||||||
|
|
||||||
mindSystem.TransferTo(mind, eUid);
|
mindSystem.TransferTo(mind, eUid, ghostOverride);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
set-mind-command-description = Transfers a mind to the specified entity. The entity must have a {$requiredComponent}.
|
set-mind-command-description = Transfers a mind to the specified entity. The entity must have a {$requiredComponent}. By default this will force minds that are currently visiting other entities to return (i.e., return a ghost to their main body).
|
||||||
set-mind-command-help-text = Usage: {$command} <entityUid> <username>
|
set-mind-command-help-text = Usage: {$command} <entityUid> <username> [unvisit]
|
||||||
set-mind-command-target-has-no-content-data-message = Target player does not have content data (wtf?)
|
set-mind-command-target-has-no-content-data-message = Target player does not have content data (wtf?)
|
||||||
set-mind-command-target-has-no-mind-message = Target entity does not have a mind (did you forget to make sentient?)
|
set-mind-command-target-has-no-mind-message = Target entity does not have a mind (did you forget to make sentient?)
|
||||||
Reference in New Issue
Block a user