Remove AlertType and AlertCategory (#27933)

This commit is contained in:
Nemanja
2024-05-23 22:43:04 -04:00
committed by GitHub
parent 594a898260
commit 8a95cb186c
69 changed files with 483 additions and 386 deletions

View File

@@ -79,8 +79,7 @@ public sealed partial class StaminaSystem : EntitySystem
{
RemCompDeferred<ActiveStaminaComponent>(uid);
}
SetStaminaAlert(uid);
_alerts.ClearAlert(uid, component.StaminaAlert);
}
private void OnStartup(EntityUid uid, StaminaComponent component, ComponentStartup args)
@@ -204,13 +203,10 @@ public sealed partial class StaminaSystem : EntitySystem
private void SetStaminaAlert(EntityUid uid, StaminaComponent? component = null)
{
if (!Resolve(uid, ref component, false) || component.Deleted)
{
_alerts.ClearAlert(uid, AlertType.Stamina);
return;
}
var severity = ContentHelpers.RoundToLevels(MathF.Max(0f, component.CritThreshold - component.StaminaDamage), component.CritThreshold, 7);
_alerts.ShowAlert(uid, AlertType.Stamina, (short) severity);
_alerts.ShowAlert(uid, component.StaminaAlert, (short) severity);
}
/// <summary>