]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
fix AI battery alert (#41879)
authorslarticodefast <161409025+slarticodefast@users.noreply.github.com>
Tue, 16 Dec 2025 18:48:20 +0000 (19:48 +0100)
committerGitHub <noreply@github.com>
Tue, 16 Dec 2025 18:48:20 +0000 (18:48 +0000)
* fix AI battery alert

* fix copy paste error

Content.Server/Silicons/StationAi/StationAiSystem.cs
Content.Shared/Alert/AlertPrototype.cs
Resources/Prototypes/Alerts/alerts.yml

index 0045b921e51af310eefaeb8bbdb5785ccb99bfff..e52400d3de4f5c9030a1b7b075435925a1c83492 100644 (file)
@@ -68,7 +68,7 @@ public sealed class StationAiSystem : SharedStationAiSystem
     private readonly ProtoId<JobPrototype> _stationAiJob = "StationAi";
     private readonly EntProtoId _stationAiBrain = "StationAiBrain";
 
-    private readonly ProtoId<AlertPrototype> _batteryAlert = "BorgBattery";
+    private readonly ProtoId<AlertPrototype> _batteryAlert = "AiBattery";
     private readonly ProtoId<AlertPrototype> _damageAlert = "BorgHealth";
 
     public override void Initialize()
index 998eb4bd4d837a58166c4ab5d7b463569cb4f1a9..ce5f919ea5d64fc3101c3bee40d670b918e6553f 100644 (file)
@@ -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.
 /// </summary>
 [Prototype]
-public sealed partial class AlertPrototype : IPrototype
+public sealed partial class AlertPrototype : IPrototype, IInheritingPrototype
 {
+    /// <inheritdoc />
+    [ParentDataField(typeof(AbstractPrototypeIdArraySerializer<AlertPrototype>))]
+    public string[]? Parents { get; private set; }
+
+    /// <inheritdoc />
+    [NeverPushInheritance]
+    [AbstractDataField]
+    public bool Abstract { get; private set; }
+
     /// <summary>
     /// Type of alert, no 2 alert prototypes should have the same one.
     /// </summary>
index 5c70b7e5f146e2ff2c9656d2cf0743bea4722463..71201611d2d06a3c6f78be5ca4d104beaeb111be 100644 (file)
   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