From bb57b93b27dc8c23d6e44b362fe3c3b3d6cb1470 Mon Sep 17 00:00:00 2001 From: Dvir <39403717+dvir001@users.noreply.github.com> Date: Thu, 24 Aug 2023 06:14:20 +0300 Subject: [PATCH] Anomaly system (#257) * Update AnomalySystem.Generator.cs * Update anomaly_equipment.yml --- Content.Server/Anomaly/AnomalySystem.Generator.cs | 12 +++--------- .../Structures/Machines/anomaly_equipment.yml | 2 ++ 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Content.Server/Anomaly/AnomalySystem.Generator.cs b/Content.Server/Anomaly/AnomalySystem.Generator.cs index f1b147ac802..f25fd96a262 100644 --- a/Content.Server/Anomaly/AnomalySystem.Generator.cs +++ b/Content.Server/Anomaly/AnomalySystem.Generator.cs @@ -149,16 +149,10 @@ private void OnGeneratingFinished(EntityUid uid, AnomalyGeneratorComponent compo { var xform = Transform(uid); - if (_station.GetStationInMap(xform.MapID) is not { } station || - !TryComp(station, out var data) || - _station.GetLargestGrid(data) is not { } grid) - { - if (xform.GridUid == null) - return; - grid = xform.GridUid.Value; - } + if (xform.GridUid == null) + return; - SpawnOnRandomGridLocation(grid, component.SpawnerPrototype); + SpawnOnRandomGridLocation(xform.GridUid.Value, component.SpawnerPrototype); RemComp(uid); Appearance.SetData(uid, AnomalyGeneratorVisuals.Generating, false); Audio.PlayPvs(component.GeneratingFinishedSound, uid); diff --git a/Resources/Prototypes/Entities/Structures/Machines/anomaly_equipment.yml b/Resources/Prototypes/Entities/Structures/Machines/anomaly_equipment.yml index be7f9a1fbeb..a68d0aa6050 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/anomaly_equipment.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/anomaly_equipment.yml @@ -301,3 +301,5 @@ - type: GuideHelp guides: - AnomalousResearch + - type: Anchorable + delay: 999999