# Description
Current implementation of `PowerCellSystem.Update()`:
```csharp
public override void Update(float frameTime)
{
base.Update(frameTime);
var query = EntityQueryEnumerator<PowerCellDrawComponent, PowerCellSlotComponent>();
while (query.MoveNext(out var uid, out var comp, out var slot))
{
if (!comp.Enabled)
continue;
if (Timing.CurTime < comp.NextUpdateTime)
continue;
comp.NextUpdateTime += comp.Delay;
if (!TryGetBatteryFromSlot(uid, out var batteryEnt, out var battery, slot))
continue;
// TCJ: "Multiplying by frameTime to make this tick-invariant. Otherwise it'll draw 30x to 60x faster than you expect."
if (_battery.TryUseCharge(batteryEnt.Value, comp.DrawRate * frameTime, battery))
continue;
var ev = new PowerCellSlotEmptyEvent();
RaiseLocalEvent(uid, ref ev);
}
}
```
Multiplying `comp.DrawRate` and `frameTime` is only valid if we're
running this code each tick. Right now all power costs are divided by 30
or 60, which, ironically enough, makes power consumption 30 to 60 times
slower than intended.
This does not affect PowerCellDrawComponents with `Delay` set to zero,
since they do get updated every tick.
This will negatively affect equipment that uses this component for
consuming power while on.
Except flashlights, because `HandheldLightSystem` handles flashlight
power draw by itself.
---
<details><summary><h1>Media</h1></summary>
<p>
<details><summary>without fix</summary>

</details>
<details><summary>with fix</summary>

</details>
</p>
</details>
---
# Changelog
<!--
You can add an author after the `🆑` to change the name that appears
in the changelog (ex: `🆑 Death`)
Leaving it blank will default to your GitHub display name
This includes all available types for the changelog
-->
🆑
- fix: Fixed some items used less power while turned on than they
should.
(cherry picked from commit d8d9141e38c1300e20c50cec322dc287500a8011)
# Description
Power cell draw wasn't tick invariant, so batteries on this codebase
were being drained anywhere from 30 to 60x faster than people expect,
depending on server performance. This was notably something that
severely effected MODSuits, which can now enjoy a battery lifespan of
around 30 minutes. But it's also a big deal for IPCs.
Closes https://github.com/Simple-Station/Einstein-Engines/issues/1956
# Changelog
🆑
- fix: Batteries no longer drain power 30 to 60 times faster than
physics states. This is particularly a large buff to IPCs and MODSuits,
who both no longer have to deal with batteries lasting an absurdly short
amount of time.
- tweak: Solarian Modsuit now provides protection from cold.
(cherry picked from commit 7df5eccecfe8a5a9eb6d12bbcdb2c545dfbe9b55)
* remove ItemToggle from PowerCellDraw query
* add EntityQuery for resolves, make them all optional
* move integration to ToggleCellDraw
* add ToggleCellDraw to almost every PowerCellDraw prototype
* :trollface:
* :trollface:
* :trollface:
* let it disable on mapinit
* set update time on mapinit, make borg power logic consistent now
* :trollface:
---------
Co-authored-by: deltanedas <@deltanedas:kde.org>
(cherry picked from commit e91fb14656469eaa2a5309c27fb51e8f7c171575)
Also includes some (non critical) changes to the solution file to re-organize the Roslyn components.
(cherry picked from commit e00f74505c62310bd15aeaba8d6530f648397074)