Remove 700 usages of Component.Owner (#21100)
This commit is contained in:
@@ -3,6 +3,7 @@ using Content.Shared.Administration;
|
||||
using Robust.Server.Player;
|
||||
using Robust.Shared.Console;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Map.Components;
|
||||
|
||||
namespace Content.Server.Construction.Commands;
|
||||
|
||||
@@ -10,7 +11,6 @@ namespace Content.Server.Construction.Commands;
|
||||
sealed class TileReplaceCommand : IConsoleCommand
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entManager = default!;
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
[Dependency] private readonly ITileDefinitionManager _tileDef = default!;
|
||||
|
||||
// ReSharper disable once StringLiteralTypo
|
||||
@@ -58,13 +58,13 @@ sealed class TileReplaceCommand : IConsoleCommand
|
||||
var tileA = _tileDef[tileIdA];
|
||||
var tileB = _tileDef[tileIdB];
|
||||
|
||||
if (!_mapManager.TryGetGrid(gridId, out var grid))
|
||||
if (!_entManager.TryGetComponent(gridId, out MapGridComponent? grid))
|
||||
{
|
||||
shell.WriteLine($"No grid exists with id {gridId}");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_entManager.EntityExists(grid.Owner))
|
||||
if (!_entManager.EntityExists(gridId))
|
||||
{
|
||||
shell.WriteLine($"Grid {gridId} doesn't have an associated grid entity.");
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user