Replace obsolete Tile Access methods (#32508)
* Replace obsolete SetTile * Remove obsolete GetTileRef & GetAllTiles * Forgor * Apply suggested `GetMapOrInvalid`
This commit is contained in:
@@ -11,6 +11,8 @@ namespace Content.Server.Power.EntitySystems;
|
||||
public sealed partial class CableSystem
|
||||
{
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
||||
[Dependency] private readonly SharedMapSystem _map = default!;
|
||||
|
||||
private void InitializeCablePlacer()
|
||||
{
|
||||
@@ -26,11 +28,12 @@ public sealed partial class CableSystem
|
||||
if (component.CablePrototypeId == null)
|
||||
return;
|
||||
|
||||
if(!TryComp<MapGridComponent>(args.ClickLocation.GetGridUid(EntityManager), out var grid))
|
||||
if(!TryComp<MapGridComponent>(_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[grid.GetTileRef(snapPos).Tile.TypeId];
|
||||
var tileDef = (ContentTileDefinition) _tileManager[_map.GetTileRef(gridUid, grid,snapPos).Tile.TypeId];
|
||||
|
||||
if (!tileDef.IsSubFloor || !tileDef.Sturdy)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user