Content update for NetEntities (#18935)

This commit is contained in:
metalgearsloth
2023-09-11 09:42:41 +10:00
committed by GitHub
parent 389c8d1a2c
commit 5a0fc68be2
526 changed files with 3058 additions and 2215 deletions

View File

@@ -14,10 +14,10 @@ public sealed class RunVerbAsCommand : ToolshedCommand
private SharedVerbSystem? _verb;
[CommandImplementation]
public IEnumerable<EntityUid> RunVerbAs(
public IEnumerable<NetEntity> RunVerbAs(
[CommandInvocationContext] IInvocationContext ctx,
[PipedArgument] IEnumerable<EntityUid> input,
[CommandArgument] ValueRef<EntityUid> runner,
[PipedArgument] IEnumerable<NetEntity> input,
[CommandArgument] ValueRef<NetEntity> runner,
[CommandArgument] string verb
)
{
@@ -26,16 +26,17 @@ public sealed class RunVerbAsCommand : ToolshedCommand
foreach (var i in input)
{
var runnerEid = runner.Evaluate(ctx);
var runnerNet = runner.Evaluate(ctx);
var runnerEid = EntityManager.GetEntity(runnerNet);
if (EntityManager.Deleted(runnerEid) && runnerEid != default)
if (EntityManager.Deleted(runnerEid) && runnerEid.IsValid())
ctx.ReportError(new DeadEntity(runnerEid));
if (ctx.GetErrors().Any())
yield break;
var verbs = _verb.GetLocalVerbs(i, runnerEid, Verb.VerbTypes, true);
var eId = EntityManager.GetEntity(i);
var verbs = _verb.GetLocalVerbs(eId, runnerEid, Verb.VerbTypes, true);
// if the "verb name" is actually a verb-type, try run any verb of that type.
var verbType = Verb.VerbTypes.FirstOrDefault(x => x.Name == verb);
@@ -44,7 +45,7 @@ public sealed class RunVerbAsCommand : ToolshedCommand
var verbTy = verbs.FirstOrDefault(v => v.GetType() == verbType);
if (verbTy != null)
{
_verb.ExecuteVerb(verbTy, runnerEid, i, forced: true);
_verb.ExecuteVerb(verbTy, runnerEid, eId, forced: true);
yield return i;
}
}
@@ -53,7 +54,7 @@ public sealed class RunVerbAsCommand : ToolshedCommand
{
if (verbTy.Text.ToLowerInvariant() == verb)
{
_verb.ExecuteVerb(verbTy, runnerEid, i, forced: true);
_verb.ExecuteVerb(verbTy, runnerEid, eId, forced: true);
yield return i;
}
}