From 11c69bca3f370e3a3fde1bc24976fd1188aebb30 Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Mon, 29 Jan 2024 11:51:29 +1100 Subject: [PATCH] Anti-anomaly fixes (#24634) - Remove unnecessary mapcoordinates get. - Remove mapping markers as everything should be ingame entities and this is functioning as an area. --- .../Anomaly/AnomalySystem.Generator.cs | 6 ++-- .../Entities/Markers/anti_anomaly_zone.yml | 33 ------------------- 2 files changed, 4 insertions(+), 35 deletions(-) delete mode 100644 Resources/Prototypes/Entities/Markers/anti_anomaly_zone.yml diff --git a/Content.Server/Anomaly/AnomalySystem.Generator.cs b/Content.Server/Anomaly/AnomalySystem.Generator.cs index 61bb356ff7..d07740e2f6 100644 --- a/Content.Server/Anomaly/AnomalySystem.Generator.cs +++ b/Content.Server/Anomaly/AnomalySystem.Generator.cs @@ -119,6 +119,8 @@ public sealed partial class AnomalySystem // don't spawn inside of solid objects var physQuery = GetEntityQuery(); var valid = true; + + // TODO: This should be using static lookup. foreach (var ent in gridComp.GetAnchoredEntities(tile)) { if (!physQuery.TryGetComponent(ent, out var body)) @@ -143,9 +145,9 @@ public sealed partial class AnomalySystem if (antiXform.MapID != mapPos.MapId) continue; - var antiCoordinates = _transform.GetMapCoordinates(antiXform); + var antiCoordinates = _transform.GetWorldPosition(antiXform); - var delta = antiCoordinates.Position - mapPos.Position; + var delta = antiCoordinates - mapPos.Position; if (delta.LengthSquared() < zone.ZoneRadius * zone.ZoneRadius) { valid = false; diff --git a/Resources/Prototypes/Entities/Markers/anti_anomaly_zone.yml b/Resources/Prototypes/Entities/Markers/anti_anomaly_zone.yml deleted file mode 100644 index fbc183613c..0000000000 --- a/Resources/Prototypes/Entities/Markers/anti_anomaly_zone.yml +++ /dev/null @@ -1,33 +0,0 @@ -- type: entity - name: anti anomaly zone - description: Anomalies will not be able to appear within a 10 block radius of this point. - id: AntiAnomalyZone - suffix: "range 10" - parent: MarkerBase - components: - - type: Sprite - sprite: Structures/Specific/Anomalies/ice_anom.rsi - layers: - - state: anom - - sprite: Markers/cross.rsi - state: pink - - type: AntiAnomalyZone - zoneRadius: 10 - -- type: entity - parent: AntiAnomalyZone - id: AntiAnomalyZone20 - suffix: "range 20" - description: Anomalies will not be able to appear within a 20 block radius of this point. - components: - - type: AntiAnomalyZone - zoneRadius: 20 - -- type: entity - parent: AntiAnomalyZone - id: AntiAnomalyZone50 - suffix: "range 50" - description: Anomalies will not be able to appear within a 50 block radius of this point. - components: - - type: AntiAnomalyZone - zoneRadius: 50 \ No newline at end of file