From 048dcd9eeb918bd24cee2a9f03624dc157b7b364 Mon Sep 17 00:00:00 2001 From: Tayrtahn Date: Tue, 8 Apr 2025 15:42:38 -0400 Subject: [PATCH] Fix `lsobjectives` target player logic (#36398) * Fix lsobjectives target player logic * Logic 3.0 --- .../Objectives/Commands/ListObjectivesCommand.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Content.Server/Objectives/Commands/ListObjectivesCommand.cs b/Content.Server/Objectives/Commands/ListObjectivesCommand.cs index 88dcdcedf6..33b98ba624 100644 --- a/Content.Server/Objectives/Commands/ListObjectivesCommand.cs +++ b/Content.Server/Objectives/Commands/ListObjectivesCommand.cs @@ -5,6 +5,7 @@ using Content.Shared.Mind; using Content.Shared.Objectives.Systems; using Robust.Server.Player; using Robust.Shared.Console; +using Robust.Shared.Player; namespace Content.Server.Objectives.Commands { @@ -18,8 +19,13 @@ namespace Content.Server.Objectives.Commands public override void Execute(IConsoleShell shell, string argStr, string[] args) { - var player = shell.Player; - if (player == null || !_players.TryGetSessionByUsername(args[0], out player)) + ICommonSession? player; + if (args.Length > 0) + _players.TryGetSessionByUsername(args[0], out player); + else + player = shell.Player; + + if (player == null) { shell.WriteError(LocalizationManager.GetString("shell-target-player-does-not-exist")); return; -- 2.51.2