fixes alert onclick (#3521)

Co-authored-by: Paul <ritter.paul1+git@googlemail.com>
This commit is contained in:
Paul Ritter
2021-03-05 12:46:04 +01:00
committed by GitHub
parent 0948c5c578
commit d6464b3ba0
3 changed files with 3 additions and 11 deletions

View File

@@ -219,7 +219,6 @@ namespace Content.Client.GameObjects.Components.Mobs
return;
}
if (!alert.Alert.HasOnClick) return;
SendNetworkMessage(new ClickAlertMessage(alert.Alert.AlertType));
}

View File

@@ -70,15 +70,13 @@ namespace Content.Server.GameObjects.Components.Mobs
break;
}
if (AlertManager.TryGet(msg.AlertType, out var alert) && alert.OnClick != null)
{
alert.OnClick.AlertClicked(new ClickAlertEventArgs(player, alert));
}
else
if (!AlertManager.TryGet(msg.AlertType, out var alert))
{
Logger.WarningS("alert", "unrecognized encoded alert {0}", msg.AlertType);
break;
}
alert.OnClick?.AlertClicked(new ClickAlertEventArgs(player, alert));
break;
}
}

View File

@@ -83,11 +83,6 @@ namespace Content.Shared.Alert
/// </summary>
public bool SupportsSeverity => MaxSeverity != -1;
/// <summary>
/// Whether this alert is clickable. This is valid clientside.
/// </summary>
public bool HasOnClick => OnClick != null;
/// <summary>
/// Defines what to do when the alert is clicked.
/// This will always be null on clientside.