Fix lsobjectives target player logic (#36398)

* Fix lsobjectives target player logic

* Logic 3.0
This commit is contained in:
Tayrtahn
2025-04-08 15:42:38 -04:00
committed by GitHub
parent d9115f8bcc
commit 048dcd9eeb

View File

@@ -5,6 +5,7 @@ using Content.Shared.Mind;
using Content.Shared.Objectives.Systems; using Content.Shared.Objectives.Systems;
using Robust.Server.Player; using Robust.Server.Player;
using Robust.Shared.Console; using Robust.Shared.Console;
using Robust.Shared.Player;
namespace Content.Server.Objectives.Commands namespace Content.Server.Objectives.Commands
{ {
@@ -18,8 +19,13 @@ namespace Content.Server.Objectives.Commands
public override void Execute(IConsoleShell shell, string argStr, string[] args) public override void Execute(IConsoleShell shell, string argStr, string[] args)
{ {
var player = shell.Player; ICommonSession? player;
if (player == null || !_players.TryGetSessionByUsername(args[0], out 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")); shell.WriteError(LocalizationManager.GetString("shell-target-player-does-not-exist"));
return; return;