From 93dccc34c58f9c06f79ce0d95b2f13d8806d83f8 Mon Sep 17 00:00:00 2001 From: Moony Date: Sat, 14 Mar 2026 18:37:02 +0100 Subject: [PATCH] Content-side IRobustRandom cleanup. (#43231) * Content-side fixes for engine IRobustRandom rejig. * Define for ensuring SetSeed works. * Poke. * Poke * Poke. --- Content.Benchmarks/Content.Benchmarks.csproj | 1 + Content.Server/Cargo/Systems/CargoSystem.Orders.cs | 1 + .../Thresholds/Behaviors/WeightedSpawnEntityBehavior.cs | 1 + Content.Server/NPC/Systems/NPCSteeringSystem.Context.cs | 1 + Content.Server/NPC/Systems/NPCSteeringSystem.Obstacles.cs | 1 + Content.Server/Salvage/SalvageSystem.Magnet.cs | 1 + .../Shuttles/Systems/EmergencyShuttleSystem.Console.cs | 1 + Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs | 1 + Content.Server/StationEvents/Events/BluespaceLockerRule.cs | 1 + Content.Server/StationEvents/Events/BreakerFlipRule.cs | 1 + Content.Server/StationEvents/Events/PowerGridCheckRule.cs | 1 + Content.Server/StationEvents/Events/SpaceSpawnRule.cs | 1 + Content.Server/StationEvents/Events/StationEventSystem.cs | 1 + Content.Server/Weapons/Ranged/Systems/GunSystem.cs | 1 + Content.Shared/Trigger/Systems/TriggerSystem.Timer.cs | 1 + 15 files changed, 15 insertions(+) diff --git a/Content.Benchmarks/Content.Benchmarks.csproj b/Content.Benchmarks/Content.Benchmarks.csproj index 8d4dfa31bd..dd0b760f4a 100644 --- a/Content.Benchmarks/Content.Benchmarks.csproj +++ b/Content.Benchmarks/Content.Benchmarks.csproj @@ -7,6 +7,7 @@ true false disable + $(DefineConstants);ALLOW_BAD_PRACTICES diff --git a/Content.Server/Cargo/Systems/CargoSystem.Orders.cs b/Content.Server/Cargo/Systems/CargoSystem.Orders.cs index 0b5f015593..baa436c41b 100644 --- a/Content.Server/Cargo/Systems/CargoSystem.Orders.cs +++ b/Content.Server/Cargo/Systems/CargoSystem.Orders.cs @@ -18,6 +18,7 @@ using Robust.Shared.Map; using Robust.Shared.Prototypes; using Robust.Shared.Timing; using Robust.Shared.Utility; +using Robust.Shared.Random; namespace Content.Server.Cargo.Systems { diff --git a/Content.Server/Destructible/Thresholds/Behaviors/WeightedSpawnEntityBehavior.cs b/Content.Server/Destructible/Thresholds/Behaviors/WeightedSpawnEntityBehavior.cs index 4a275ac895..2e04971972 100644 --- a/Content.Server/Destructible/Thresholds/Behaviors/WeightedSpawnEntityBehavior.cs +++ b/Content.Server/Destructible/Thresholds/Behaviors/WeightedSpawnEntityBehavior.cs @@ -7,6 +7,7 @@ using Robust.Server.GameObjects; using Robust.Shared.Prototypes; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; using Robust.Shared.Spawners; +using Robust.Shared.Random; namespace Content.Server.Destructible.Thresholds.Behaviors; diff --git a/Content.Server/NPC/Systems/NPCSteeringSystem.Context.cs b/Content.Server/NPC/Systems/NPCSteeringSystem.Context.cs index c083be6134..40a3b43ea6 100644 --- a/Content.Server/NPC/Systems/NPCSteeringSystem.Context.cs +++ b/Content.Server/NPC/Systems/NPCSteeringSystem.Context.cs @@ -12,6 +12,7 @@ using Robust.Shared.Map; using Robust.Shared.Physics; using Robust.Shared.Physics.Components; using ClimbingComponent = Content.Shared.Climbing.Components.ClimbingComponent; +using Robust.Shared.Random; namespace Content.Server.NPC.Systems; diff --git a/Content.Server/NPC/Systems/NPCSteeringSystem.Obstacles.cs b/Content.Server/NPC/Systems/NPCSteeringSystem.Obstacles.cs index a31c7850f3..e0886f141a 100644 --- a/Content.Server/NPC/Systems/NPCSteeringSystem.Obstacles.cs +++ b/Content.Server/NPC/Systems/NPCSteeringSystem.Obstacles.cs @@ -12,6 +12,7 @@ using Robust.Shared.Physics.Components; using Robust.Shared.Utility; using ClimbableComponent = Content.Shared.Climbing.Components.ClimbableComponent; using ClimbingComponent = Content.Shared.Climbing.Components.ClimbingComponent; +using Robust.Shared.Random; namespace Content.Server.NPC.Systems; diff --git a/Content.Server/Salvage/SalvageSystem.Magnet.cs b/Content.Server/Salvage/SalvageSystem.Magnet.cs index ee5cd792c6..9133f1239b 100644 --- a/Content.Server/Salvage/SalvageSystem.Magnet.cs +++ b/Content.Server/Salvage/SalvageSystem.Magnet.cs @@ -9,6 +9,7 @@ using Content.Shared.Salvage.Magnet; using Robust.Shared.Exceptions; using Robust.Shared.Map; using Robust.Shared.Prototypes; +using Robust.Shared.Random; namespace Content.Server.Salvage; diff --git a/Content.Server/Shuttles/Systems/EmergencyShuttleSystem.Console.cs b/Content.Server/Shuttles/Systems/EmergencyShuttleSystem.Console.cs index 95d638dec7..3b28d007f6 100644 --- a/Content.Server/Shuttles/Systems/EmergencyShuttleSystem.Console.cs +++ b/Content.Server/Shuttles/Systems/EmergencyShuttleSystem.Console.cs @@ -16,6 +16,7 @@ using Robust.Shared.Map; using Robust.Shared.Player; using Robust.Shared.Prototypes; using Timer = Robust.Shared.Timing.Timer; +using Robust.Shared.Random; namespace Content.Server.Shuttles.Systems; diff --git a/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs b/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs index 0705944c35..54bfdbad14 100644 --- a/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs +++ b/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs @@ -24,6 +24,7 @@ using Robust.Shared.Physics.Components; using Robust.Shared.Player; using Robust.Shared.Utility; using FTLMapComponent = Content.Shared.Shuttles.Components.FTLMapComponent; +using Robust.Shared.Random; namespace Content.Server.Shuttles.Systems; diff --git a/Content.Server/StationEvents/Events/BluespaceLockerRule.cs b/Content.Server/StationEvents/Events/BluespaceLockerRule.cs index 5e0ce6eb67..1fe8f1f038 100644 --- a/Content.Server/StationEvents/Events/BluespaceLockerRule.cs +++ b/Content.Server/StationEvents/Events/BluespaceLockerRule.cs @@ -6,6 +6,7 @@ using Content.Shared.Access.Components; using Content.Shared.Station.Components; using Content.Shared.Storage.Components; using Content.Shared.GameTicking.Components; +using Robust.Shared.Random; namespace Content.Server.StationEvents.Events; diff --git a/Content.Server/StationEvents/Events/BreakerFlipRule.cs b/Content.Server/StationEvents/Events/BreakerFlipRule.cs index 3ab9fbd209..745db7a0cd 100644 --- a/Content.Server/StationEvents/Events/BreakerFlipRule.cs +++ b/Content.Server/StationEvents/Events/BreakerFlipRule.cs @@ -4,6 +4,7 @@ using Content.Server.StationEvents.Components; using Content.Shared.GameTicking.Components; using Content.Shared.Station.Components; using JetBrains.Annotations; +using Robust.Shared.Random; namespace Content.Server.StationEvents.Events; diff --git a/Content.Server/StationEvents/Events/PowerGridCheckRule.cs b/Content.Server/StationEvents/Events/PowerGridCheckRule.cs index 3a86f694ab..b0cc0bc993 100644 --- a/Content.Server/StationEvents/Events/PowerGridCheckRule.cs +++ b/Content.Server/StationEvents/Events/PowerGridCheckRule.cs @@ -9,6 +9,7 @@ using Robust.Shared.Audio; using Robust.Shared.Player; using Robust.Shared.Utility; using Timer = Robust.Shared.Timing.Timer; +using Robust.Shared.Random; namespace Content.Server.StationEvents.Events { diff --git a/Content.Server/StationEvents/Events/SpaceSpawnRule.cs b/Content.Server/StationEvents/Events/SpaceSpawnRule.cs index 08e43b4c68..9453477bd6 100644 --- a/Content.Server/StationEvents/Events/SpaceSpawnRule.cs +++ b/Content.Server/StationEvents/Events/SpaceSpawnRule.cs @@ -3,6 +3,7 @@ using Content.Server.StationEvents.Components; using Content.Shared.GameTicking.Components; using Robust.Shared.Map; using Robust.Shared.Map.Components; +using Robust.Shared.Random; namespace Content.Server.StationEvents.Events; diff --git a/Content.Server/StationEvents/Events/StationEventSystem.cs b/Content.Server/StationEvents/Events/StationEventSystem.cs index aaa48a482e..e0ec1328be 100644 --- a/Content.Server/StationEvents/Events/StationEventSystem.cs +++ b/Content.Server/StationEvents/Events/StationEventSystem.cs @@ -9,6 +9,7 @@ using Content.Shared.GameTicking.Components; using Robust.Shared.Audio.Systems; using Robust.Shared.Player; using Robust.Shared.Prototypes; +using Robust.Shared.Random; namespace Content.Server.StationEvents.Events; diff --git a/Content.Server/Weapons/Ranged/Systems/GunSystem.cs b/Content.Server/Weapons/Ranged/Systems/GunSystem.cs index 53db706d6e..910bd719ba 100644 --- a/Content.Server/Weapons/Ranged/Systems/GunSystem.cs +++ b/Content.Server/Weapons/Ranged/Systems/GunSystem.cs @@ -17,6 +17,7 @@ using Robust.Shared.Map; using Robust.Shared.Player; using Robust.Shared.Prototypes; using Robust.Shared.Utility; +using Robust.Shared.Random; namespace Content.Server.Weapons.Ranged.Systems; diff --git a/Content.Shared/Trigger/Systems/TriggerSystem.Timer.cs b/Content.Shared/Trigger/Systems/TriggerSystem.Timer.cs index 179b04af93..39b7864316 100644 --- a/Content.Shared/Trigger/Systems/TriggerSystem.Timer.cs +++ b/Content.Shared/Trigger/Systems/TriggerSystem.Timer.cs @@ -2,6 +2,7 @@ using Content.Shared.Trigger.Components.Triggers; using Content.Shared.Examine; using Content.Shared.Verbs; +using Robust.Shared.Random; namespace Content.Shared.Trigger.Systems;