]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Force map confirmation (#29391)
authorArkiveDev <95712736+ArkiveDev@users.noreply.github.com>
Mon, 24 Jun 2024 10:56:21 +0000 (06:56 -0400)
committerGitHub <noreply@github.com>
Mon, 24 Jun 2024 10:56:21 +0000 (13:56 +0300)
* Add map check to forcemap command

* remove debug line

* remove accidental newline

Content.Server/GameTicking/Commands/ForceMapCommand.cs

index 5d2191fb52de9c43b0a57271e0e84979c7a6b4ea..5677ff4b8ff7b36ad971cfe5306d702e4425f292 100644 (file)
@@ -29,6 +29,12 @@ namespace Content.Server.GameTicking.Commands
             var gameMap = IoCManager.Resolve<IGameMapManager>();
             var name = args[0];
 
+            if (!gameMap.TrySelectMapIfEligible(name))
+            {
+                shell.WriteLine($"No eligible map exists with name {name}.");
+                return;
+            }
+
             _configurationManager.SetCVar(CCVars.GameMap, name);
             shell.WriteLine(Loc.GetString("forcemap-command-success", ("map", name)));
         }