Make RunVerbAs take and return EntityUids (#38155)
fix: make RunVerbAs take and return EntityUids
This commit is contained in:
@@ -14,9 +14,9 @@ public sealed class RunVerbAsCommand : ToolshedCommand
|
||||
private SharedVerbSystem? _verb;
|
||||
|
||||
[CommandImplementation]
|
||||
public IEnumerable<NetEntity> RunVerbAs(
|
||||
public IEnumerable<EntityUid> RunVerbAs(
|
||||
IInvocationContext ctx,
|
||||
[PipedArgument] IEnumerable<NetEntity> input,
|
||||
[PipedArgument] IEnumerable<EntityUid> input,
|
||||
EntityUid runner,
|
||||
string verb
|
||||
)
|
||||
@@ -24,7 +24,7 @@ public sealed class RunVerbAsCommand : ToolshedCommand
|
||||
_verb ??= GetSys<SharedVerbSystem>();
|
||||
verb = verb.ToLowerInvariant();
|
||||
|
||||
foreach (var i in input)
|
||||
foreach (var eId in input)
|
||||
{
|
||||
if (EntityManager.Deleted(runner) && runner.IsValid())
|
||||
ctx.ReportError(new DeadEntity(runner));
|
||||
@@ -32,7 +32,6 @@ public sealed class RunVerbAsCommand : ToolshedCommand
|
||||
if (ctx.GetErrors().Any())
|
||||
yield break;
|
||||
|
||||
var eId = EntityManager.GetEntity(i);
|
||||
var verbs = _verb.GetLocalVerbs(eId, runner, Verb.VerbTypes, true);
|
||||
|
||||
// if the "verb name" is actually a verb-type, try run any verb of that type.
|
||||
@@ -43,7 +42,7 @@ public sealed class RunVerbAsCommand : ToolshedCommand
|
||||
if (verbTy != null)
|
||||
{
|
||||
_verb.ExecuteVerb(verbTy, runner, eId, forced: true);
|
||||
yield return i;
|
||||
yield return eId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +51,7 @@ public sealed class RunVerbAsCommand : ToolshedCommand
|
||||
if (verbTy.Text.ToLowerInvariant() == verb)
|
||||
{
|
||||
_verb.ExecuteVerb(verbTy, runner, eId, forced: true);
|
||||
yield return i;
|
||||
yield return eId;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user