Skip to content

Commit

Permalink
Fix TEG acting as infinite energy source on destruction (#29972)
Browse files Browse the repository at this point in the history
* TEG now checks for power supply before checking for IsFullyBuilt

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

Co-authored-by: ShadowCommander <[email protected]>

---------

Co-authored-by: metalgearsloth <[email protected]>
Co-authored-by: ShadowCommander <[email protected]>
  • Loading branch information
3 people authored Sep 19, 2024
1 parent c2f0626 commit 9c905cd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Content.Server/Power/Generation/Teg/TegSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,6 @@ private void GeneratorExamined(EntityUid uid, TegGeneratorComponent component, E

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)
Expand All @@ -114,6 +110,10 @@ private void GeneratorUpdate(EntityUid uid, TegGeneratorComponent component, ref
return;
}

var tegGroup = GetNodeGroup(uid);
if (tegGroup is not { IsFullyBuilt: true })
return;

var circA = tegGroup.CirculatorA!.Owner;
var circB = tegGroup.CirculatorB!.Owner;

Expand Down

0 comments on commit 9c905cd

Please sign in to comment.