]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix Station AI being affected by Bureaucratic Event (#32021)
authorSlamBamActionman <83650252+SlamBamActionman@users.noreply.github.com>
Wed, 11 Sep 2024 11:24:24 +0000 (13:24 +0200)
committerGitHub <noreply@github.com>
Wed, 11 Sep 2024 11:24:24 +0000 (13:24 +0200)
* init commit

* I forgot components exist

* delta told me to make it a list

Content.Server/StationEvents/Components/BureaucraticErrorRuleComponent.cs
Content.Server/StationEvents/Events/BureaucraticErrorRule.cs
Resources/Prototypes/GameRules/events.yml

index 6dfbd9083e8538fe7f9617a7653b825443c619d3..346e75e2eeb063a858c0b43d942c7d39e8827acb 100644 (file)
@@ -1,9 +1,15 @@
-using Content.Server.StationEvents.Events;
+using Content.Server.StationEvents.Events;
+using Content.Shared.Roles;
+using Robust.Shared.Prototypes;
 
 namespace Content.Server.StationEvents.Components;
 
 [RegisterComponent, Access(typeof(BureaucraticErrorRule))]
 public sealed partial class BureaucraticErrorRuleComponent : Component
 {
-
+    /// <summary>
+    /// The jobs that are ignored by this rule and won't have their slots changed.
+    /// </summary>
+    [DataField]
+    public List<ProtoId<JobPrototype>> IgnoredJobs = new();
 }
index b49049a10d43e815348e91b4b87a53b294465253..2ddc7245cf5cb934c42b77ed5e9ea6d892dbd6aa 100644 (file)
@@ -1,9 +1,9 @@
 using System.Linq;
-using Content.Server.GameTicking.Rules.Components;
 using Content.Server.Station.Components;
 using Content.Server.Station.Systems;
 using Content.Server.StationEvents.Components;
 using Content.Shared.GameTicking.Components;
+using Content.Shared.Roles;
 using JetBrains.Annotations;
 using Robust.Shared.Random;
 
@@ -23,6 +23,9 @@ public sealed class BureaucraticErrorRule : StationEventSystem<BureaucraticError
 
         var jobList = _stationJobs.GetJobs(chosenStation.Value).Keys.ToList();
 
+        foreach(var job in component.IgnoredJobs)
+            jobList.Remove(job);
+
         if (jobList.Count == 0)
             return;
 
index 8a56cfc25744e0872b12c9d6da93f8a6d5245141..773f8946bfbe1ca7ed818f17055a247a9141841b 100644 (file)
     weight: 3
     duration: 1
   - type: BureaucraticErrorRule
+    ignoredJobs:
+    - StationAi
 
 - type: entity
   id: ClericalError