]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix for Tesla Twins Miniboss (#41199)
authorErrant <35878406+Errant-4@users.noreply.github.com>
Fri, 31 Oct 2025 20:23:28 +0000 (21:23 +0100)
committerGitHub <noreply@github.com>
Fri, 31 Oct 2025 20:23:28 +0000 (20:23 +0000)
* increase QA standards on the Tesla Generator production line

* comment

* Inert datafield and code

* I'm not even supposed to be here today

Content.Server/Singularity/EntitySystems/SingularityGeneratorSystem.cs
Content.Shared/Singularity/Components/SingularityGeneratorComponent.cs

index 884d62504552c6668c45fa03942588f0a3ca9cf9..44c5da13a8843f640687b35725f99bc8b0a44548 100644 (file)
@@ -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<SingularityGeneratorComponent>(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;
index 715584b5bc64d79970bebb0aa5b292c99588a5b7..8d4317e743e3703a4cb85f84531aca0e3e4bf100 100644 (file)
@@ -24,6 +24,13 @@ public sealed partial class SingularityGeneratorComponent : Component
     [DataField]
     public float Threshold = 16;
 
+    /// <summary>
+    /// 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.
+    /// </summary>
+    [DataField]
+    public bool Inert;
+
     /// <summary>
     /// Allows the generator to ignore all the failsafe stuff, e.g. when emagged
     /// </summary>