Skip to content

Commit

Permalink
TEG can power itself when turned on (space-wizards#29072)
Browse files Browse the repository at this point in the history
  • Loading branch information
WarMechanic authored Jun 23, 2024
1 parent f15ccea commit 9f9cf08
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Content.Server/Power/Generation/Teg/TegSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,12 @@ private void GeneratorUpdate(EntityUid uid, TegGeneratorComponent component, ref
// Turn energy (at atmos tick rate) into wattage.
var power = electricalEnergy / args.dt;
// Add ramp factor. This magics slight power into existence, but allows us to ramp up.
supplier.MaxSupply = power * component.RampFactor;
power *= component.RampFactor;

// Simulate TEG powering itself after being started up. This means that if LV is lost this keeps running.
const float load = 1000;
supplier.MaxSupply = Math.Max(power - load, 0);
powerReceiver.Load = Math.Max(load - power, 0);

var circAComp = Comp<TegCirculatorComponent>(circA);
var circBComp = Comp<TegCirculatorComponent>(circB);
Expand Down

0 comments on commit 9f9cf08

Please sign in to comment.