Fix TEG acting as infinite energy source on destruction (#29972)

* TEG now checks for power supply before checking for IsFullyBuilt

* Update Content.Server/Power/Generation/Teg/TegSystem.cs

Co-authored-by: ShadowCommander <10494922+ShadowCommander@users.noreply.github.com>

---------

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Co-authored-by: ShadowCommander <10494922+ShadowCommander@users.noreply.github.com>
This commit is contained in:
Luiz Costa
2024-09-18 23:15:44 -03:00
committed by GitHub
parent c2f0626e02
commit 9c905cd58f

View File

@@ -102,10 +102,6 @@ public sealed class TegSystem : EntitySystem
private void GeneratorUpdate(EntityUid uid, TegGeneratorComponent component, ref AtmosDeviceUpdateEvent args)
{
var tegGroup = GetNodeGroup(uid);
if (tegGroup is not { IsFullyBuilt: true })
return;
var supplier = Comp<PowerSupplierComponent>(uid);
var powerReceiver = Comp<ApcPowerReceiverComponent>(uid);
if (!powerReceiver.Powered)
@@ -114,6 +110,10 @@ public sealed class TegSystem : EntitySystem
return;
}
var tegGroup = GetNodeGroup(uid);
if (tegGroup is not { IsFullyBuilt: true })
return;
var circA = tegGroup.CirculatorA!.Owner;
var circB = tegGroup.CirculatorB!.Owner;