From 1520acdf5ae687fd2420b8fd969502f42ff61361 Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Mon, 14 Dec 2020 06:16:40 +0100 Subject: [PATCH] Fix the mapping command not pausing the created map (#2742) --- Content.Server/Commands/GameTicking/MappingCommand.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Content.Server/Commands/GameTicking/MappingCommand.cs b/Content.Server/Commands/GameTicking/MappingCommand.cs index 985362de9d..8b82ca4fc8 100644 --- a/Content.Server/Commands/GameTicking/MappingCommand.cs +++ b/Content.Server/Commands/GameTicking/MappingCommand.cs @@ -3,6 +3,7 @@ using Content.Server.Administration; using Content.Shared.Administration; using Robust.Server.Interfaces.Console; using Robust.Server.Interfaces.Player; +using Robust.Server.Interfaces.Timing; using Robust.Shared.Interfaces.Map; using Robust.Shared.IoC; using Robust.Shared.Utility; @@ -60,9 +61,12 @@ namespace Content.Server.Commands.GameTicking shell.ExecuteCommand(player, "aghost"); shell.ExecuteCommand(player, $"tp 0 0 {mapId}"); - var newGridId = mapManager.GetAllGrids().Max(g => (int) g.Index); + var newGrid = mapManager.GetAllGrids().OrderByDescending(g => g.Index).First(); + var pauseManager = IoCManager.Resolve(); - shell.SendText(player, $"Created unloaded map from file {mapName} with id {mapId}. Use \"savebp {newGridId} foo.yml\" to save the new grid as a map."); + pauseManager.SetMapPaused(newGrid.ParentMapId, true); + + shell.SendText(player, $"Created unloaded map from file {mapName} with id {mapId}. Use \"savebp {newGrid.Index} foo.yml\" to save the new grid as a map."); } } -} \ No newline at end of file +}