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
This commit is contained in:
Errant
2025-10-31 21:23:28 +01:00
committed by GitHub
parent 79035cd023
commit d893cda971
2 changed files with 12 additions and 1 deletions

View 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;

View 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>