fix power cell exceptions with health analyzers (#15753)
This commit is contained in:
@@ -224,7 +224,7 @@ public sealed class PowerCellSystem : SharedPowerCellSystem
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public bool TryUseCharge(EntityUid uid, float charge, PowerCellSlotComponent? component = null, EntityUid? user = null)
|
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)
|
if (user != null)
|
||||||
_popup.PopupEntity(Loc.GetString("power-cell-no-battery"), uid, user.Value);
|
_popup.PopupEntity(Loc.GetString("power-cell-no-battery"), uid, user.Value);
|
||||||
@@ -232,7 +232,7 @@ public sealed class PowerCellSystem : SharedPowerCellSystem
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_battery.TryUseCharge(uid, charge, battery))
|
if (!_battery.TryUseCharge(batteryEnt.Value, charge, battery))
|
||||||
{
|
{
|
||||||
if (user != null)
|
if (user != null)
|
||||||
_popup.PopupEntity(Loc.GetString("power-cell-insufficient"), uid, user.Value);
|
_popup.PopupEntity(Loc.GetString("power-cell-insufficient"), uid, user.Value);
|
||||||
|
|||||||
Reference in New Issue
Block a user