diff --git a/Content.Server/Administration/Commands/WarpCommand.cs b/Content.Server/Administration/Commands/WarpCommand.cs index c4aa41db20..afc42c7e19 100644 --- a/Content.Server/Administration/Commands/WarpCommand.cs +++ b/Content.Server/Administration/Commands/WarpCommand.cs @@ -48,7 +48,7 @@ namespace Content.Server.Administration.Commands } else { - if (player.Status != SessionStatus.InGame || player.AttachedEntity is not {Valid: true} playerEntity) + if (player.Status != SessionStatus.InGame || player.AttachedEntity is not { Valid: true } playerEntity) { shell.WriteLine("You are not in-game!"); return; @@ -57,14 +57,16 @@ namespace Content.Server.Administration.Commands var currentMap = _entManager.GetComponent(playerEntity).MapID; var currentGrid = _entManager.GetComponent(playerEntity).GridUid; + var xformSystem = _entManager.System(); + var found = GetWarpPointByName(location) .OrderBy(p => p.Item1, Comparer.Create((a, b) => { // Sort so that warp points on the same grid/map are first. // So if you have two maps loaded with the same warp points, // it will prefer the warp points on the map you're currently on. - var aGrid = a.GetGridUid(_entManager); - var bGrid = b.GetGridUid(_entManager); + var aGrid = xformSystem.GetGrid(a); + var bGrid = xformSystem.GetGrid(b); if (aGrid == bGrid) { @@ -81,8 +83,8 @@ namespace Content.Server.Administration.Commands return 1; } - var mapA = a.GetMapId(_entManager); - var mapB = a.GetMapId(_entManager); + var mapA = xformSystem.GetMapId(a); + var mapB = xformSystem.GetMapId(b); if (mapA == mapB) { @@ -117,10 +119,8 @@ namespace Content.Server.Administration.Commands return; } - var xform = _entManager.GetComponent(playerEntity); - var xformSystem = _entManager.System(); - xform.Coordinates = coords; - xformSystem.AttachToGridOrMap(playerEntity, xform); + xformSystem.SetCoordinates(playerEntity, coords); + xformSystem.AttachToGridOrMap(playerEntity); if (_entManager.TryGetComponent(playerEntity, out PhysicsComponent? physics)) { _entManager.System().SetLinearVelocity(playerEntity, Vector2.Zero, body: physics);