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:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -125,6 +125,8 @@
|
||||
weight: 3
|
||||
duration: 1
|
||||
- type: BureaucraticErrorRule
|
||||
ignoredJobs:
|
||||
- StationAi
|
||||
|
||||
- type: entity
|
||||
id: ClericalError
|
||||
|
||||
Reference in New Issue
Block a user