Health analyzer displays turns off when the battery dies (#16125)

This commit is contained in:
Vasilis
2023-05-13 18:28:11 +02:00
committed by GitHub
parent 407d8c3c8b
commit 4f8d4f89d6
7 changed files with 26 additions and 5 deletions

View File

@@ -166,7 +166,6 @@ public sealed class PowerCellSystem : SharedPowerCellSystem
return HasCharge(uid, battery.UseRate, cell, user);
}
/// <summary>
/// Tries to use the <see cref="PowerCellDrawComponent.UseRate"/> for this entity.
/// </summary>
@@ -179,6 +178,7 @@ public sealed class PowerCellSystem : SharedPowerCellSystem
if (TryUseCharge(uid, battery.UseRate, cell, user))
{
_sharedAppearanceSystem.SetData(uid, PowerCellSlotVisuals.Enabled, HasActivatableCharge(uid, battery, cell, user));
_activatable.CheckUsage(uid);
return true;
}
@@ -243,6 +243,7 @@ public sealed class PowerCellSystem : SharedPowerCellSystem
return false;
}
_sharedAppearanceSystem.SetData(uid, PowerCellSlotVisuals.Enabled, battery.Charge > 0);
return true;
}