diff --git a/Content.Server/_Sunrise/Synth/SynthSystem.cs b/Content.Server/_Sunrise/Synth/SynthSystem.cs index f40522a13b7..84a92d4b3e1 100644 --- a/Content.Server/_Sunrise/Synth/SynthSystem.cs +++ b/Content.Server/_Sunrise/Synth/SynthSystem.cs @@ -229,10 +229,10 @@ 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); @@ -240,10 +240,10 @@ private bool TryGetBattery(EntityUid uid, [NotNullWhen(true)] out EntityUid? po { foreach (var content in container.ContainedEntities) { - if (TryComp(content, out var PowerCellComp)) + if (HasComp(content) && TryComp(content, out var BatteryComp)) { powercell = content; - powercellComponent = PowerCellComp; + batteryComponent = BatteryComp; return true; }