Forcemap can be cleared with empty string again (#29472)
This commit is contained in:
@@ -29,14 +29,19 @@ namespace Content.Server.GameTicking.Commands
|
||||
var gameMap = IoCManager.Resolve<IGameMapManager>();
|
||||
var name = args[0];
|
||||
|
||||
if (!gameMap.CheckMapExists(name))
|
||||
// An empty string clears the forced map
|
||||
if (!string.IsNullOrEmpty(name) && !gameMap.CheckMapExists(name))
|
||||
{
|
||||
shell.WriteLine(Loc.GetString("forcemap-command-map-not-found", ("map", name)));
|
||||
return;
|
||||
}
|
||||
|
||||
_configurationManager.SetCVar(CCVars.GameMap, name);
|
||||
shell.WriteLine(Loc.GetString("forcemap-command-success", ("map", name)));
|
||||
|
||||
if (string.IsNullOrEmpty(name))
|
||||
shell.WriteLine(Loc.GetString("forcemap-command-cleared"));
|
||||
else
|
||||
shell.WriteLine(Loc.GetString("forcemap-command-success", ("map", name)));
|
||||
}
|
||||
|
||||
public CompletionResult GetCompletion(IConsoleShell shell, string[] args)
|
||||
|
||||
Reference in New Issue
Block a user