From 946073f3d28cc44ac5feed37a92f3aa42a4de064 Mon Sep 17 00:00:00 2001 From: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> Date: Sat, 22 Jul 2023 23:57:13 -0400 Subject: [PATCH] fix anomalies spawning on escape pods (#18225) --- .../StationEvents/Events/AnomalySpawnRule.cs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/Content.Server/StationEvents/Events/AnomalySpawnRule.cs b/Content.Server/StationEvents/Events/AnomalySpawnRule.cs index 6ed2c0eb45..a59af52f6d 100644 --- a/Content.Server/StationEvents/Events/AnomalySpawnRule.cs +++ b/Content.Server/StationEvents/Events/AnomalySpawnRule.cs @@ -1,9 +1,7 @@ -using System.Linq; -using Content.Server.Anomaly; +using Content.Server.Anomaly; using Content.Server.GameTicking.Rules.Components; using Content.Server.Station.Components; using Content.Server.StationEvents.Components; -using Robust.Shared.Random; namespace Content.Server.StationEvents.Events; @@ -30,13 +28,9 @@ public sealed class AnomalySpawnRule : StationEventSystem(chosenStation, out var stationData)) return; - EntityUid? grid = null; - foreach (var g in stationData.Grids.Where(HasComp)) - { - grid = g; - } + var grid = StationSystem.GetLargestGrid(stationData); - if (grid is not { }) + if (grid is null) return; var amountToSpawn = Math.Max(1, (int) MathF.Round(GetSeverityModifier() / 2));