From: jjtParadox Date: Tue, 28 Mar 2023 11:58:13 +0000 (-0500) Subject: Fix Bureaucratic Error event affecting fewer jobs than intended (#14921) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=5c129c49da85c04487ab1723f23c1bda8b36b229;p=space-station-14.git Fix Bureaucratic Error event affecting fewer jobs than intended (#14921) --- diff --git a/Content.Server/StationEvents/Events/BureaucraticError.cs b/Content.Server/StationEvents/Events/BureaucraticError.cs index 3343fe83e0..a96eae51b5 100644 --- a/Content.Server/StationEvents/Events/BureaucraticError.cs +++ b/Content.Server/StationEvents/Events/BureaucraticError.cs @@ -41,13 +41,14 @@ public sealed class BureaucraticError : StationEventSystem var lower = (int) (jobList.Count * Math.Min(1.0f, 0.20 * mod)); var upper = (int) (jobList.Count * Math.Min(1.0f, 0.30 * mod)); // Changing every role is maybe a bit too chaotic so instead change 20-30% of them. - for (var i = 0; i < RobustRandom.Next(lower, upper); i++) + var num = RobustRandom.Next(lower, upper); + for (var i = 0; i < num; i++) { var chosenJob = RobustRandom.PickAndTake(jobList); if (_stationJobs.IsJobUnlimited(chosenStation, chosenJob)) continue; - _stationJobs.TryAdjustJobSlot(chosenStation, chosenJob, RobustRandom.Next(-3, 6)); + _stationJobs.TryAdjustJobSlot(chosenStation, chosenJob, RobustRandom.Next(-3, 6), clamp: true); } } }