Make RunVerbAs take and return EntityUids (#38155)

fix: make RunVerbAs take and return EntityUids
This commit is contained in:
Perry Fraser
2025-07-14 11:45:13 -04:00
committed by GitHub
parent d9545dd380
commit 7c7aeffde2

View File

@@ -14,9 +14,9 @@ public sealed class RunVerbAsCommand : ToolshedCommand
private SharedVerbSystem? _verb; private SharedVerbSystem? _verb;
[CommandImplementation] [CommandImplementation]
public IEnumerable<NetEntity> RunVerbAs( public IEnumerable<EntityUid> RunVerbAs(
IInvocationContext ctx, IInvocationContext ctx,
[PipedArgument] IEnumerable<NetEntity> input, [PipedArgument] IEnumerable<EntityUid> input,
EntityUid runner, EntityUid runner,
string verb string verb
) )
@@ -24,7 +24,7 @@ public sealed class RunVerbAsCommand : ToolshedCommand
_verb ??= GetSys<SharedVerbSystem>(); _verb ??= GetSys<SharedVerbSystem>();
verb = verb.ToLowerInvariant(); verb = verb.ToLowerInvariant();
foreach (var i in input) foreach (var eId in input)
{ {
if (EntityManager.Deleted(runner) && runner.IsValid()) if (EntityManager.Deleted(runner) && runner.IsValid())
ctx.ReportError(new DeadEntity(runner)); ctx.ReportError(new DeadEntity(runner));
@@ -32,7 +32,6 @@ public sealed class RunVerbAsCommand : ToolshedCommand
if (ctx.GetErrors().Any()) if (ctx.GetErrors().Any())
yield break; yield break;
var eId = EntityManager.GetEntity(i);
var verbs = _verb.GetLocalVerbs(eId, runner, Verb.VerbTypes, true); 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. // 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) if (verbTy != null)
{ {
_verb.ExecuteVerb(verbTy, runner, eId, forced: true); _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) if (verbTy.Text.ToLowerInvariant() == verb)
{ {
_verb.ExecuteVerb(verbTy, runner, eId, forced: true); _verb.ExecuteVerb(verbTy, runner, eId, forced: true);
yield return i; yield return eId;
} }
} }
} }