Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace obsolete code in AnomalySystem.Generator.cs #31718

Merged
merged 2 commits into from
Sep 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions Content.Server/Anomaly/AnomalySystem.Generator.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Content.Server.Anomaly.Components;
using Content.Server.Power.Components;
using Content.Server.Power.EntitySystems;
using Content.Server.Station.Components;
using Content.Shared.Anomaly;
Expand All @@ -11,10 +10,7 @@
using Robust.Shared.Map.Components;
using Robust.Shared.Physics;
using Robust.Shared.Physics.Components;
using Robust.Shared.Map;
using System.Numerics;
using Content.Shared.Power;
using Robust.Server.GameObjects;

namespace Content.Server.Anomaly;

Expand Down Expand Up @@ -115,7 +111,7 @@ public void SpawnOnRandomGridLocation(EntityUid grid, string toSpawn)
var valid = true;

// TODO: This should be using static lookup.
foreach (var ent in gridComp.GetAnchoredEntities(tile))
foreach (var ent in _mapSystem.GetAnchoredEntities(grid, gridComp, tile))
{
if (!physQuery.TryGetComponent(ent, out var body))
continue;
Expand All @@ -131,10 +127,10 @@ public void SpawnOnRandomGridLocation(EntityUid grid, string toSpawn)
continue;

var pos = _mapSystem.GridTileToLocal(grid, gridComp, tile);
var mapPos = pos.ToMap(EntityManager, _transform);
var mapPos = _transform.ToMapCoordinates(pos);
// don't spawn in AntiAnomalyZones
var antiAnomalyZonesQueue = AllEntityQuery<AntiAnomalyZoneComponent, TransformComponent>();
while (antiAnomalyZonesQueue.MoveNext(out var uid, out var zone, out var antiXform))
while (antiAnomalyZonesQueue.MoveNext(out _, out var zone, out var antiXform))
{
if (antiXform.MapID != mapPos.MapId)
continue;
Expand Down
Loading