From 411b563b1f8789b3ccc65daf41e2d45c40c70306 Mon Sep 17 00:00:00 2001 From: Tayrtahn Date: Wed, 23 Apr 2025 18:14:50 -0400 Subject: [PATCH] Cleanup warnings in `CableSystem.Placer` (#36868) * Fix warnings in CableSystem.Placer * Formatting --- .../Power/EntitySystems/CableSystem.Placer.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Content.Server/Power/EntitySystems/CableSystem.Placer.cs b/Content.Server/Power/EntitySystems/CableSystem.Placer.cs index a5cf54fae0..5d9105a3fc 100644 --- a/Content.Server/Power/EntitySystems/CableSystem.Placer.cs +++ b/Content.Server/Power/EntitySystems/CableSystem.Placer.cs @@ -28,17 +28,18 @@ public sealed partial class CableSystem if (component.CablePrototypeId == null) return; - if(!TryComp(_transform.GetGrid(args.ClickLocation), out var grid)) + if (!TryComp(_transform.GetGrid(args.ClickLocation), out var grid)) return; var gridUid = _transform.GetGrid(args.ClickLocation)!.Value; - var snapPos = grid.TileIndicesFor(args.ClickLocation); - var tileDef = (ContentTileDefinition) _tileManager[_map.GetTileRef(gridUid, grid,snapPos).Tile.TypeId]; + var snapPos = _map.TileIndicesFor((gridUid, grid), args.ClickLocation); + var tileDef = (ContentTileDefinition)_tileManager[_map.GetTileRef(gridUid, grid, snapPos).Tile.TypeId]; if (!tileDef.IsSubFloor || !tileDef.Sturdy) return; - foreach (var anchored in grid.GetAnchoredEntities(snapPos)) + + foreach (var anchored in _map.GetAnchoredEntities((gridUid, grid), snapPos)) { if (TryComp(anchored, out var wire) && wire.CableType == component.BlockingCableType) return; @@ -47,7 +48,7 @@ public sealed partial class CableSystem if (TryComp(placer, out var stack) && !_stack.Use(placer, 1, stack)) return; - var newCable = EntityManager.SpawnEntity(component.CablePrototypeId, grid.GridTileToLocal(snapPos)); + var newCable = EntityManager.SpawnEntity(component.CablePrototypeId, _map.GridTileToLocal(gridUid, grid, snapPos)); _adminLogger.Add(LogType.Construction, LogImpact.Low, $"{ToPrettyString(args.User):player} placed {ToPrettyString(newCable):cable} at {Transform(newCable).Coordinates}"); args.Handled = true; -- 2.51.2