mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
Make RunVerbAs take and return EntityUids (#38155)
fix: make RunVerbAs take and return EntityUids
This commit is contained in:
parent
d9545dd380
commit
7c7aeffde2
1 changed files with 5 additions and 6 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue