From 274be663b0150e3a281f4a0d53f2265086e250bc Mon Sep 17 00:00:00 2001 From: Slava0135 <40753025+Slava0135@users.noreply.github.com> Date: Sat, 28 Jan 2023 17:06:40 +0300 Subject: [PATCH] make vent clog event only affect single station vents (#13703) --- Content.Server/StationEvents/Events/VentClog.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Content.Server/StationEvents/Events/VentClog.cs b/Content.Server/StationEvents/Events/VentClog.cs index c108c6de78..ba7c2c55bf 100644 --- a/Content.Server/StationEvents/Events/VentClog.cs +++ b/Content.Server/StationEvents/Events/VentClog.cs @@ -1,5 +1,6 @@ using Content.Server.Atmos.Piping.Unary.Components; using Content.Server.Chemistry.ReactionEffects; +using Content.Server.Station.Components; using Content.Shared.Chemistry.Components; using Content.Shared.Chemistry.Reagent; using JetBrains.Annotations; @@ -23,6 +24,10 @@ public sealed class VentClog : StationEventSystem { base.Started(); + if (StationSystem.Stations.Count == 0) + return; + var chosenStation = RobustRandom.Pick(StationSystem.Stations.ToList()); + // TODO: "safe random" for chems. Right now this includes admin chemicals. var allReagents = PrototypeManager.EnumeratePrototypes() .Where(x => !x.Abstract) @@ -34,6 +39,10 @@ public sealed class VentClog : StationEventSystem foreach (var (_, transform) in EntityManager.EntityQuery()) { + if (CompOrNull(transform.GridUid)?.Station != chosenStation) + { + continue; + } var solution = new Solution(); if (!RobustRandom.Prob(Math.Min(0.33f * mod, 1.0f)))