fix dead alert (#4558)
This commit is contained in:
parent
e3cf87a106
commit
c7cfc8a90c
2 changed files with 13 additions and 9 deletions
|
|
@ -61,17 +61,17 @@ namespace Content.Server.Alert
|
|||
break;
|
||||
}
|
||||
|
||||
if (!IsShowingAlert(msg.AlertType))
|
||||
if (!IsShowingAlert(msg.Type))
|
||||
{
|
||||
Logger.DebugS("alert", "user {0} attempted to" +
|
||||
" click alert {1} which is not currently showing for them",
|
||||
player.Name, msg.AlertType);
|
||||
player.Name, msg.Type);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!AlertManager.TryGet(msg.AlertType, out var alert))
|
||||
if (!AlertManager.TryGet(msg.Type, out var alert))
|
||||
{
|
||||
Logger.WarningS("alert", "unrecognized encoded alert {0}", msg.AlertType);
|
||||
Logger.WarningS("alert", "unrecognized encoded alert {0}", msg.Type);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -87,9 +87,12 @@ namespace Content.Shared.Alert
|
|||
{
|
||||
if (AlertManager.TryGet(alertType, out var alert))
|
||||
{
|
||||
// Check whether the alert category we want to show is already being displayed, with the same type,
|
||||
// severity, and cooldown.
|
||||
if (_alerts.TryGetValue(alert.AlertKey, out var alertStateCallback) &&
|
||||
alert.AlertType == alertType &&
|
||||
alertStateCallback.Severity == severity && alertStateCallback.Cooldown == cooldown)
|
||||
alertStateCallback.Type == alertType &&
|
||||
alertStateCallback.Severity == severity &&
|
||||
alertStateCallback.Cooldown == cooldown)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -98,7 +101,7 @@ namespace Content.Shared.Alert
|
|||
_alerts.Remove(alert.AlertKey);
|
||||
|
||||
_alerts[alert.AlertKey] = new AlertState
|
||||
{Cooldown = cooldown, Severity = severity};
|
||||
{Cooldown = cooldown, Severity = severity, Type=alertType};
|
||||
|
||||
AfterShowAlert();
|
||||
|
||||
|
|
@ -180,12 +183,12 @@ namespace Content.Shared.Alert
|
|||
[Serializable, NetSerializable]
|
||||
public class ClickAlertMessage : ComponentMessage
|
||||
{
|
||||
public readonly AlertType AlertType;
|
||||
public readonly AlertType Type;
|
||||
|
||||
public ClickAlertMessage(AlertType alertType)
|
||||
{
|
||||
Directed = true;
|
||||
AlertType = alertType;
|
||||
Type = alertType;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -194,5 +197,6 @@ namespace Content.Shared.Alert
|
|||
{
|
||||
public short? Severity;
|
||||
public ValueTuple<TimeSpan, TimeSpan>? Cooldown;
|
||||
public AlertType Type;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue