From 53a33a58530e5e00f4bdf5c9cefc2387e0179aec Mon Sep 17 00:00:00 2001 From: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> Date: Mon, 24 Apr 2023 21:11:03 -0400 Subject: [PATCH] fix power cell exceptions with health analyzers (#15753) --- Content.Server/PowerCell/PowerCellSystem.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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);