Replace obsolete map functions in disposals code (#31133)
This commit is contained in:
@@ -32,6 +32,8 @@ namespace Content.Server.Disposal.Tube
|
|||||||
[Dependency] private readonly SharedContainerSystem _containerSystem = default!;
|
[Dependency] private readonly SharedContainerSystem _containerSystem = default!;
|
||||||
[Dependency] private readonly AtmosphereSystem _atmosSystem = default!;
|
[Dependency] private readonly AtmosphereSystem _atmosSystem = default!;
|
||||||
[Dependency] private readonly TransformSystem _transform = default!;
|
[Dependency] private readonly TransformSystem _transform = default!;
|
||||||
|
[Dependency] private readonly SharedMapSystem _map = default!;
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
@@ -345,7 +347,7 @@ namespace Content.Server.Disposal.Tube
|
|||||||
return null;
|
return null;
|
||||||
|
|
||||||
var position = xform.Coordinates;
|
var position = xform.Coordinates;
|
||||||
foreach (var entity in grid.GetInDir(position, nextDirection))
|
foreach (var entity in _map.GetInDir(xform.GridUid.Value, grid, position, nextDirection))
|
||||||
{
|
{
|
||||||
if (!TryComp(entity, out DisposalTubeComponent? tube))
|
if (!TryComp(entity, out DisposalTubeComponent? tube))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem
|
|||||||
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
|
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
|
||||||
[Dependency] private readonly TransformSystem _transformSystem = default!;
|
[Dependency] private readonly TransformSystem _transformSystem = default!;
|
||||||
[Dependency] private readonly UserInterfaceSystem _ui = default!;
|
[Dependency] private readonly UserInterfaceSystem _ui = default!;
|
||||||
|
[Dependency] private readonly SharedMapSystem _map = default!;
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
@@ -474,7 +475,7 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem
|
|||||||
var delay = insertingSelf ? unit.EntryDelay : unit.DraggedEntryDelay;
|
var delay = insertingSelf ? unit.EntryDelay : unit.DraggedEntryDelay;
|
||||||
|
|
||||||
if (userId != null && !insertingSelf)
|
if (userId != null && !insertingSelf)
|
||||||
_popupSystem.PopupEntity(Loc.GetString("disposal-unit-being-inserted", ("user", Identity.Entity((EntityUid) userId, EntityManager))), toInsertId, toInsertId, PopupType.Large);
|
_popupSystem.PopupEntity(Loc.GetString("disposal-unit-being-inserted", ("user", Identity.Entity((EntityUid)userId, EntityManager))), toInsertId, toInsertId, PopupType.Large);
|
||||||
|
|
||||||
if (delay <= 0 || userId == null)
|
if (delay <= 0 || userId == null)
|
||||||
{
|
{
|
||||||
@@ -520,7 +521,7 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
var coords = xform.Coordinates;
|
var coords = xform.Coordinates;
|
||||||
var entry = grid.GetLocal(coords)
|
var entry = _map.GetLocal(xform.GridUid.Value, grid, coords)
|
||||||
.FirstOrDefault(HasComp<DisposalEntryComponent>);
|
.FirstOrDefault(HasComp<DisposalEntryComponent>);
|
||||||
|
|
||||||
if (entry == default || component is not DisposalUnitComponent sDisposals)
|
if (entry == default || component is not DisposalUnitComponent sDisposals)
|
||||||
|
|||||||
Reference in New Issue
Block a user