Skip to content

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
  • Loading branch information
Rinary1 committed Nov 1, 2024
1 parent ddabab3 commit 77e1967
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Content.Server/_Sunrise/Synth/SynthSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -229,21 +229,21 @@ private void OnDrain(EntityUid uid, EntityUid user, SynthComponent component)
_doAfter.TryStartDoAfter(doAfterArgs);
}

private bool TryGetBattery(EntityUid uid, [NotNullWhen(true)] out EntityUid? powercell, [NotNullWhen(true)] out PowerCellComponent? powercellComponent)
private bool TryGetBattery(EntityUid uid, [NotNullWhen(true)] out EntityUid? powercell, [NotNullWhen(true)] out BatteryComponent? batteryComponent)
{
powercell = null;
powercellComponent = null;
batteryComponent = null;

var bodyContainers = _bodySystem.GetBodyContainers(uid);

if (_containerSystem.TryGetContainer(uid, "cell_slot", out var container) && container.ContainedEntities.Count > 0)
{
foreach (var content in container.ContainedEntities)
{
if (TryComp<PowerCellComponent>(content, out var PowerCellComp))
if (HasComp<PowerCellComponent>(content) && TryComp<BatteryComponent>(content, out var BatteryComp))
{
powercell = content;
powercellComponent = PowerCellComp;
batteryComponent = BatteryComp;

return true;
}
Expand Down

0 comments on commit 77e1967

Please sign in to comment.