Skip to content

Commit

Permalink
Revert "setgamepreset command rework (#30756)"
Browse files Browse the repository at this point in the history
This reverts commit de86fdb.
  • Loading branch information
metalgearsloth authored Aug 9, 2024
1 parent b8fc879 commit 9a16f95
Show file tree
Hide file tree
Showing 4 changed files with 228 additions and 264 deletions.
17 changes: 4 additions & 13 deletions Content.Server/GameTicking/Commands/SetGamePresetCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using Content.Server.Administration;
using Content.Server.GameTicking.Presets;
using Content.Shared.Administration;
using Linguini.Shared.Util;
using Robust.Shared.Console;
using Robust.Shared.Prototypes;

Expand All @@ -20,9 +19,9 @@ public sealed class SetGamePresetCommand : IConsoleCommand

public void Execute(IConsoleShell shell, string argStr, string[] args)
{
if (!args.Length.InRange(1, 2))
if (args.Length != 1)
{
shell.WriteError(Loc.GetString("shell-need-between-arguments", ("lower", 1), ("upper", 2), ("currentAmount", args.Length)));
shell.WriteError(Loc.GetString("shell-wrong-arguments-number-need-specific", ("properAmount", 1), ("currentAmount", args.Length)));
return;
}

Expand All @@ -34,16 +33,8 @@ public void Execute(IConsoleShell shell, string argStr, string[] args)
return;
}

var rounds = 1;

if (args.Length == 2 && !int.TryParse(args[1], out rounds))
{
shell.WriteError(Loc.GetString("set-game-preset-optional-argument-not-integer"));
return;
}

ticker.SetGamePreset(preset, false, rounds);
shell.WriteLine(Loc.GetString("set-game-preset-preset-set-finite", ("preset", preset.ID), ("rounds", rounds.ToString())));
ticker.SetGamePreset(preset);
shell.WriteLine(Loc.GetString("set-game-preset-preset-set", ("preset", preset.ID)));
}

public CompletionResult GetCompletion(IConsoleShell shell, string[] args)
Expand Down
Loading

0 comments on commit 9a16f95

Please sign in to comment.