Replace loadbp usages with loadmap (#6085)

This commit is contained in:
metalgearsloth
2022-01-11 17:51:52 +11:00
committed by GitHub
parent 3503228985
commit db8c6e4bc8
3 changed files with 26 additions and 15 deletions

View File

@@ -68,15 +68,15 @@ namespace Content.Server.GameTicking.Commands
return;
}
// loadmap checks for this on its own but we want to avoid running our other commands.
if (mapManager.MapExists(new MapId(mapId)))
{
shell.WriteLine($"Map {mapId} already exists");
shell.WriteError($"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");
shell.ExecuteCommand($"loadmap {mapId} \"{CommandParsing.Escape(mapName)}\" true");
if (player.AttachedEntity is {Valid: true} playerEntity &&
_entities.GetComponent<MetaDataComponent>(playerEntity).EntityPrototype?.ID != "AdminObserver")