From 1364bfd4221f2fcc24113170f022094314fe4bbe Mon Sep 17 00:00:00 2001 From: Tayrtahn Date: Tue, 25 Mar 2025 18:16:48 -0400 Subject: [PATCH] Cleanup SpecialRespawnSystem (#36087) * grid.TileIndicesFor -> _map.TileIndicesFor * coords.ToMap -> _transform.ToMapCoordinates * grid.TryGetTileRef -> _map.TryGetTileRef * grid.GridTileToWorldPos -> _map.GridTileToWorldPos * grid.WorldToTile -> _map.WorldToTile * grid.GridTileToLocal -> _map.GridTileToLocal * Formatting why not --- Content.Server/Respawn/SpecialRespawnSystem.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Content.Server/Respawn/SpecialRespawnSystem.cs b/Content.Server/Respawn/SpecialRespawnSystem.cs index e7a2385e74..cde0fd2aa0 100644 --- a/Content.Server/Respawn/SpecialRespawnSystem.cs +++ b/Content.Server/Respawn/SpecialRespawnSystem.cs @@ -111,7 +111,7 @@ public sealed class SpecialRespawnSystem : SharedSpecialRespawnSystem if (tile.IsSpace(_tileDefinitionManager) || _turf.IsTileBlocked(tile, CollisionGroup.MobMask) || !_atmosphere.IsTileMixtureProbablySafe(entityGridUid, entityMapUid.Value, - grid.TileIndicesFor(mapPos))) + _map.TileIndicesFor((entityGridUid.Value, grid), mapPos))) { continue; } @@ -136,7 +136,7 @@ public sealed class SpecialRespawnSystem : SharedSpecialRespawnSystem private void Respawn(EntityUid oldEntity, string prototype, EntityCoordinates coords) { var entity = Spawn(prototype, coords); - _adminLog.Add(LogType.Respawn, LogImpact.Extreme, $"{ToPrettyString(oldEntity)} was deleted and was respawned at {coords.ToMap(EntityManager, _transform)} as {ToPrettyString(entity)}"); + _adminLog.Add(LogType.Respawn, LogImpact.Extreme, $"{ToPrettyString(oldEntity)} was deleted and was respawned at {_transform.ToMapCoordinates(coords)} as {ToPrettyString(entity)}"); _chat.SendAdminAlert($"{MetaData(oldEntity).EntityName} was deleted and was respawned as {ToPrettyString(entity)}"); } @@ -157,7 +157,7 @@ public sealed class SpecialRespawnSystem : SharedSpecialRespawnSystem var xform = Transform(targetGrid); - if (!grid.TryGetTileRef(xform.Coordinates, out var tileRef)) + if (!_map.TryGetTileRef(targetGrid, grid, xform.Coordinates, out var tileRef)) return false; var tile = tileRef.GridIndices; @@ -169,12 +169,12 @@ public sealed class SpecialRespawnSystem : SharedSpecialRespawnSystem //Obviously don't put anything ridiculous in here for (var i = 0; i < maxAttempts; i++) { - var randomX = _random.Next((int) gridBounds.Left, (int) gridBounds.Right); - var randomY = _random.Next((int) gridBounds.Bottom, (int) gridBounds.Top); + var randomX = _random.Next((int)gridBounds.Left, (int)gridBounds.Right); + var randomY = _random.Next((int)gridBounds.Bottom, (int)gridBounds.Top); - tile = new Vector2i(randomX - (int) gridPos.X, randomY - (int) gridPos.Y); - var mapPos = grid.GridTileToWorldPos(tile); - var mapTarget = grid.WorldToTile(mapPos); + tile = new Vector2i(randomX - (int)gridPos.X, randomY - (int)gridPos.Y); + var mapPos = _map.GridTileToWorldPos(targetGrid, grid, tile); + var mapTarget = _map.WorldToTile(targetGrid, grid, mapPos); var circle = new Circle(mapPos, 2); foreach (var newTileRef in _map.GetTilesIntersecting(targetGrid, grid, circle)) @@ -183,7 +183,7 @@ public sealed class SpecialRespawnSystem : SharedSpecialRespawnSystem continue; found = true; - targetCoords = grid.GridTileToLocal(tile); + targetCoords = _map.GridTileToLocal(targetGrid, grid, tile); break; } -- 2.51.2