From c4c139041ceb6d72450d2d66e1870bf1aba1398f Mon Sep 17 00:00:00 2001 From: wrexbe <81056464+wrexbe@users.noreply.github.com> Date: Thu, 2 Dec 2021 20:25:50 -0800 Subject: [PATCH] Mapping: Check if map already exists (#5666) --- Content.Server/GameTicking/Commands/MappingCommand.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Content.Server/GameTicking/Commands/MappingCommand.cs b/Content.Server/GameTicking/Commands/MappingCommand.cs index 7bad8b642d..4909402ea3 100644 --- a/Content.Server/GameTicking/Commands/MappingCommand.cs +++ b/Content.Server/GameTicking/Commands/MappingCommand.cs @@ -64,6 +64,12 @@ namespace Content.Server.GameTicking.Commands return; } + if (mapManager.MapExists(new MapId(mapId))) + { + shell.WriteLine($"Map {mapId} already exists"); + return; + } + shell.ExecuteCommand("sudo cvar events.enabled false"); shell.ExecuteCommand($"addmap {mapId} false"); shell.ExecuteCommand($"loadbp {mapId} \"{CommandParsing.Escape(mapName)}\" true");