* increase QA standards on the Tesla Generator production line
* comment
* Inert datafield and code
* I'm not even supposed to be here today
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);
}
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;
[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>