From a64c71535ee9daf3c174b495e4ed78d6dd45e997 Mon Sep 17 00:00:00 2001 From: Milon Date: Tue, 15 Oct 2024 01:43:16 +0200 Subject: [PATCH 1/2] untroll glimmermobspawnrule (#1980) * fix your shit * take 2 * take 3 --- .../Events/GlimmerMobSpawnRule.cs | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/Content.Server/DeltaV/StationEvents/Events/GlimmerMobSpawnRule.cs b/Content.Server/DeltaV/StationEvents/Events/GlimmerMobSpawnRule.cs index f1ec9372897..9acfd3021d5 100644 --- a/Content.Server/DeltaV/StationEvents/Events/GlimmerMobSpawnRule.cs +++ b/Content.Server/DeltaV/StationEvents/Events/GlimmerMobSpawnRule.cs @@ -1,5 +1,6 @@ using System.Linq; using Content.Server.Psionics.Glimmer; +using Content.Server.Station.Systems; using Content.Server.StationEvents; using Content.Server.StationEvents.Components; using Content.Server.StationEvents.Events; @@ -15,14 +16,18 @@ namespace Content.Server.DeltaV.StationEvents.Events; public sealed class GlimmerMobRule : StationEventSystem { [Dependency] private readonly GlimmerSystem _glimmer = default!; + [Dependency] private readonly StationSystem _stationSystem = default!; protected override void Started(EntityUid uid, GlimmerMobRuleComponent comp, GameRuleComponent gameRule, GameRuleStartedEvent args) { base.Started(uid, comp, gameRule, args); - var glimmerSources = GetCoords(); - var normalSpawns = GetCoords(); - var hiddenSpawns = GetCoords(); + if (!TryGetRandomStation(out var station)) + return; + + var glimmerSources = GetCoords(station.Value); + var normalSpawns = GetCoords(station.Value); + var hiddenSpawns = GetCoords(station.Value); var psionics = EntityQuery().Count(); var baseCount = Math.Max(1, psionics / comp.MobsPerPsionic); @@ -43,15 +48,19 @@ protected override void Started(EntityUid uid, GlimmerMobRuleComponent comp, Gam } } - private List GetCoords() where T : IComponent + private List GetCoords(EntityUid station) where T : IComponent { var coords = new List(); var query = EntityQueryEnumerator(); + while (query.MoveNext(out var xform, out _)) { - coords.Add(xform.Coordinates); - } + if (xform.GridUid == null) + continue; + if (_stationSystem.GetOwningStation(xform.GridUid.Value) == station) + coords.Add(xform.Coordinates); + } return coords; } From 054bd8b7e8584caa40821114d8787f9429f7548c Mon Sep 17 00:00:00 2001 From: Delta-V bot <135767721+DeltaV-Bot@users.noreply.github.com> Date: Tue, 15 Oct 2024 01:43:35 +0200 Subject: [PATCH 2/2] Automatic changelog update --- Resources/Changelog/DeltaVChangelog.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Resources/Changelog/DeltaVChangelog.yml b/Resources/Changelog/DeltaVChangelog.yml index 9d93237bb1d..474cc6567cf 100644 --- a/Resources/Changelog/DeltaVChangelog.yml +++ b/Resources/Changelog/DeltaVChangelog.yml @@ -1,10 +1,4 @@ Entries: -- author: JJ - changes: - - message: Add Psionic Antag Objectives - type: Add - id: 110 - time: '2023-10-28T19:06:51.0000000+00:00' - author: DebugOk changes: - message: The 10 reserved whitelist slots have been removed until further notice. @@ -3674,3 +3668,10 @@ id: 609 time: '2024-10-14T18:07:41.0000000+00:00' url: https://github.com/DeltaV-Station/Delta-v/pull/1985 +- author: MilonPL + changes: + - message: Glimmer mobs will no longer spawn on CentCom or the evac shuttle. + type: Fix + id: 610 + time: '2024-10-14T23:43:17.0000000+00:00' + url: https://github.com/DeltaV-Station/Delta-v/pull/1980