From: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> Date: Tue, 25 Apr 2023 01:11:03 +0000 (-0400) Subject: fix power cell exceptions with health analyzers (#15753) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=53a33a58530e5e00f4bdf5c9cefc2387e0179aec;p=space-station-14.git fix power cell exceptions with health analyzers (#15753) --- diff --git a/Content.Server/PowerCell/PowerCellSystem.cs b/Content.Server/PowerCell/PowerCellSystem.cs index c6112c7355..4b0f322c94 100644 --- a/Content.Server/PowerCell/PowerCellSystem.cs +++ b/Content.Server/PowerCell/PowerCellSystem.cs @@ -224,7 +224,7 @@ public sealed class PowerCellSystem : SharedPowerCellSystem /// public bool TryUseCharge(EntityUid uid, float charge, PowerCellSlotComponent? component = null, EntityUid? user = null) { - if (!TryGetBatteryFromSlot(uid, out var battery, component)) + if (!TryGetBatteryFromSlot(uid, out var batteryEnt, out var battery, component)) { if (user != null) _popup.PopupEntity(Loc.GetString("power-cell-no-battery"), uid, user.Value); @@ -232,7 +232,7 @@ public sealed class PowerCellSystem : SharedPowerCellSystem return false; } - if (!_battery.TryUseCharge(uid, charge, battery)) + if (!_battery.TryUseCharge(batteryEnt.Value, charge, battery)) { if (user != null) _popup.PopupEntity(Loc.GetString("power-cell-insufficient"), uid, user.Value);