Fix mark verb

This commit is contained in:
ElectroJr
2025-01-03 18:45:02 +13:00
parent 48c13b32f4
commit e5468982f5
2 changed files with 3 additions and 4 deletions

View File

@@ -105,7 +105,7 @@ namespace Content.Server.Administration.Systems
mark.Text = Loc.GetString("toolshed-verb-mark");
mark.Message = Loc.GetString("toolshed-verb-mark-description");
mark.Category = VerbCategory.Admin;
mark.Act = () => _toolshed.InvokeCommand(player, "=> $marked", Enumerable.Repeat(args.Target, 1), out _);
mark.Act = () => _toolshed.InvokeCommand(player, "=> $marked", new List<EntityUid> {args.Target}, out _);
mark.Impact = LogImpact.Low;
args.Verbs.Add(mark);

View File

@@ -9,8 +9,7 @@ public sealed class MarkedCommand : ToolshedCommand
[CommandImplementation]
public IEnumerable<EntityUid> Marked(IInvocationContext ctx)
{
var res = (IEnumerable<EntityUid>?)ctx.ReadVar("marked");
res ??= Array.Empty<EntityUid>();
return res;
var marked = ctx.ReadVar("marked") as IEnumerable<EntityUid>;
return marked ?? Array.Empty<EntityUid>();
}
}