]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix misc. flesh anomaly exceptions (#15750)
authorNemanja <98561806+EmoGarbage404@users.noreply.github.com>
Tue, 25 Apr 2023 01:13:44 +0000 (21:13 -0400)
committerGitHub <noreply@github.com>
Tue, 25 Apr 2023 01:13:44 +0000 (11:13 +1000)
Content.Server/Anomaly/Effects/FleshAnomalySystem.cs

index 227721fd7ae0337934db3f1ccbc595f5fc91b201..faa2cde7c30e8387002713dc869ac14da46db7f1 100644 (file)
@@ -63,12 +63,19 @@ public sealed class FleshAnomalySystem : EntitySystem
 
     private void SpawnMonstersOnOpenTiles(FleshAnomalyComponent component, TransformComponent xform, int amount, float radius)
     {
+        if (!component.Spawns.Any())
+            return;
+
         if (!_map.TryGetGrid(xform.GridUid, out var grid))
             return;
 
         var localpos = xform.Coordinates.Position;
         var tilerefs = grid.GetLocalTilesIntersecting(
             new Box2(localpos + (-radius, -radius), localpos + (radius, radius))).ToArray();
+
+        if (tilerefs.Length == 0)
+            return;
+
         _random.Shuffle(tilerefs);
         var physQuery = GetEntityQuery<PhysicsComponent>();
         var amountCounter = 0;