Fix Station AI being affected by Bureaucratic Event (#32021)

* init commit

* I forgot components exist

* delta told me to make it a list
This commit is contained in:
SlamBamActionman
2024-09-11 13:24:24 +02:00
committed by GitHub
parent 95195350f1
commit 5740a88208
3 changed files with 14 additions and 3 deletions

View 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();
}

View 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;

View File

@@ -125,6 +125,8 @@
weight: 3
duration: 1
- type: BureaucraticErrorRule
ignoredJobs:
- StationAi
- type: entity
id: ClericalError