Fix obsolete MapGridComponent warning in SpawnAfterInteractSystem (#37911)

This commit is contained in:
TemporalOroboros
2025-05-28 15:34:40 -07:00
committed by GitHub
parent 29ccce134b
commit f81d216630

View File

@@ -18,6 +18,7 @@ namespace Content.Server.Engineering.EntitySystems
[Dependency] private readonly StackSystem _stackSystem = default!;
[Dependency] private readonly TurfSystem _turfSystem = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
[Dependency] private readonly SharedMapSystem _maps = default!;
public override void Initialize()
{
@@ -32,9 +33,11 @@ namespace Content.Server.Engineering.EntitySystems
return;
if (string.IsNullOrEmpty(component.Prototype))
return;
if (!TryComp<MapGridComponent>(_transform.GetGrid(args.ClickLocation), out var grid))
var gridUid = _transform.GetGrid(args.ClickLocation);
if (!TryComp<MapGridComponent>(gridUid, out var grid))
return;
if (!grid.TryGetTileRef(args.ClickLocation, out var tileRef))
if (!_maps.TryGetTileRef(gridUid.Value, grid, args.ClickLocation, out var tileRef))
return;
bool IsTileClear()