From d893cda971cffe231e921da8d99298a4d534bbda Mon Sep 17 00:00:00 2001 From: Errant <35878406+Errant-4@users.noreply.github.com> Date: Fri, 31 Oct 2025 21:23:28 +0100 Subject: [PATCH] Fix for Tesla Twins Miniboss (#41199) * increase QA standards on the Tesla Generator production line * comment * Inert datafield and code * I'm not even supposed to be here today --- .../EntitySystems/SingularityGeneratorSystem.cs | 6 +++++- .../Components/SingularityGeneratorComponent.cs | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Content.Server/Singularity/EntitySystems/SingularityGeneratorSystem.cs b/Content.Server/Singularity/EntitySystems/SingularityGeneratorSystem.cs index 884d625045..44c5da13a8 100644 --- a/Content.Server/Singularity/EntitySystems/SingularityGeneratorSystem.cs +++ b/Content.Server/Singularity/EntitySystems/SingularityGeneratorSystem.cs @@ -53,6 +53,9 @@ public sealed class SingularityGeneratorSystem : SharedSingularityGeneratorSyste return; SetPower(uid, 0, comp); + + // Other particle entities from the same wave could trigger additional teslas to spawn, so we must block the generator + comp.Inert = true; Spawn(comp.SpawnPrototype, Transform(uid).Coordinates); } @@ -112,7 +115,8 @@ public sealed class SingularityGeneratorSystem : SharedSingularityGeneratorSyste if (!TryComp(args.OtherEntity, out var generatorComp)) return; - if (_timing.CurTime < _metadata.GetPauseTime(uid) + generatorComp.NextFailsafe && !generatorComp.FailsafeDisabled) + if (generatorComp.Inert || + _timing.CurTime < generatorComp.NextFailsafe && !generatorComp.FailsafeDisabled) { QueueDel(uid); return; diff --git a/Content.Shared/Singularity/Components/SingularityGeneratorComponent.cs b/Content.Shared/Singularity/Components/SingularityGeneratorComponent.cs index 715584b5bc..8d4317e743 100644 --- a/Content.Shared/Singularity/Components/SingularityGeneratorComponent.cs +++ b/Content.Shared/Singularity/Components/SingularityGeneratorComponent.cs @@ -24,6 +24,13 @@ public sealed partial class SingularityGeneratorComponent : Component [DataField] public float Threshold = 16; + /// + /// An inert generator will never be charged by particles, even if emagged. + /// This is normally only used between activating and being destroyed, to avoid creating duplicate teslas. + /// + [DataField] + public bool Inert; + /// /// Allows the generator to ignore all the failsafe stuff, e.g. when emagged ///