From 5facf93b4af88c4fae5a7cf165706565b6133087 Mon Sep 17 00:00:00 2001 From: slarticodefast <161409025+slarticodefast@users.noreply.github.com> Date: Tue, 16 Dec 2025 19:48:20 +0100 Subject: [PATCH] fix AI battery alert (#41879) * fix AI battery alert * fix copy paste error --- Content.Server/Silicons/StationAi/StationAiSystem.cs | 2 +- Content.Shared/Alert/AlertPrototype.cs | 12 +++++++++++- Resources/Prototypes/Alerts/alerts.yml | 5 +++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Content.Server/Silicons/StationAi/StationAiSystem.cs b/Content.Server/Silicons/StationAi/StationAiSystem.cs index 0045b921e5..e52400d3de 100644 --- a/Content.Server/Silicons/StationAi/StationAiSystem.cs +++ b/Content.Server/Silicons/StationAi/StationAiSystem.cs @@ -68,7 +68,7 @@ public sealed class StationAiSystem : SharedStationAiSystem private readonly ProtoId _stationAiJob = "StationAi"; private readonly EntProtoId _stationAiBrain = "StationAiBrain"; - private readonly ProtoId _batteryAlert = "BorgBattery"; + private readonly ProtoId _batteryAlert = "AiBattery"; private readonly ProtoId _damageAlert = "BorgHealth"; public override void Initialize() diff --git a/Content.Shared/Alert/AlertPrototype.cs b/Content.Shared/Alert/AlertPrototype.cs index 998eb4bd4d..ce5f919ea5 100644 --- a/Content.Shared/Alert/AlertPrototype.cs +++ b/Content.Shared/Alert/AlertPrototype.cs @@ -1,4 +1,5 @@ using Robust.Shared.Prototypes; +using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Array; using Robust.Shared.Utility; namespace Content.Shared.Alert; @@ -7,8 +8,17 @@ namespace Content.Shared.Alert; /// An alert popup with associated icon, tooltip, and other data. /// [Prototype] -public sealed partial class AlertPrototype : IPrototype +public sealed partial class AlertPrototype : IPrototype, IInheritingPrototype { + /// + [ParentDataField(typeof(AbstractPrototypeIdArraySerializer))] + public string[]? Parents { get; private set; } + + /// + [NeverPushInheritance] + [AbstractDataField] + public bool Abstract { get; private set; } + /// /// Type of alert, no 2 alert prototypes should have the same one. /// diff --git a/Resources/Prototypes/Alerts/alerts.yml b/Resources/Prototypes/Alerts/alerts.yml index 5c70b7e5f1..71201611d2 100644 --- a/Resources/Prototypes/Alerts/alerts.yml +++ b/Resources/Prototypes/Alerts/alerts.yml @@ -295,6 +295,11 @@ description: alerts-no-battery-desc clientHandled: true # the power cell battery is read on the client so that we don't have to periodically network the charge +- type: alert + parent: BorgBattery + id: AiBattery + clientHandled: false # the station AI does not have a predicted battery, so we need to send the alert from the server + - type: alert id: Internals category: Internals -- 2.52.0