]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix `lsobjectives` target player logic (#36398)
authorTayrtahn <tayrtahn@gmail.com>
Tue, 8 Apr 2025 19:42:38 +0000 (15:42 -0400)
committerGitHub <noreply@github.com>
Tue, 8 Apr 2025 19:42:38 +0000 (21:42 +0200)
* Fix lsobjectives target player logic

* Logic 3.0

Content.Server/Objectives/Commands/ListObjectivesCommand.cs

index 88dcdcedf65a552cc36c9530b97188115725d723..33b98ba62455f0d310c5e6bdc67d955735da5ca7 100644 (file)
@@ -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;