From de13ff96639d8da5ca45b214e0c4df5ebf20856a Mon Sep 17 00:00:00 2001 From: Mervill Date: Mon, 2 Sep 2024 14:50:35 -0700 Subject: [PATCH] Fix warnings related to non-exhaustive pattern matching. (#31763) old man shakes fist at modern syntax --- .../EntitySystems/ParticleAcceleratorSystem.ControlBox.cs | 1 + Content.Server/StationEvents/Events/IonStormRule.cs | 3 ++- Content.Server/StationRecords/Systems/StationRecordsSystem.cs | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Content.Server/ParticleAccelerator/EntitySystems/ParticleAcceleratorSystem.ControlBox.cs b/Content.Server/ParticleAccelerator/EntitySystems/ParticleAcceleratorSystem.ControlBox.cs index 17943c1c98..404eb00fef 100644 --- a/Content.Server/ParticleAccelerator/EntitySystems/ParticleAcceleratorSystem.ControlBox.cs +++ b/Content.Server/ParticleAccelerator/EntitySystems/ParticleAcceleratorSystem.ControlBox.cs @@ -165,6 +165,7 @@ public sealed partial class ParticleAcceleratorSystem or ParticleAcceleratorPowerState.Level1 or ParticleAcceleratorPowerState.Level2 => LogImpact.Medium, ParticleAcceleratorPowerState.Level3 => LogImpact.Extreme, + _ => throw new IndexOutOfRangeException(nameof(strength)), }; _adminLogger.Add(LogType.Action, impact, $"{ToPrettyString(player):player} has set the strength of {ToPrettyString(uid)} to {strength}"); diff --git a/Content.Server/StationEvents/Events/IonStormRule.cs b/Content.Server/StationEvents/Events/IonStormRule.cs index b20b81822f..7a959eb1e3 100644 --- a/Content.Server/StationEvents/Events/IonStormRule.cs +++ b/Content.Server/StationEvents/Events/IonStormRule.cs @@ -200,7 +200,8 @@ public sealed class IonStormRule : StationEventSystem { 0 => threats, 1 => crew1, - 2 => objects + 2 => objects, + _ => throw new IndexOutOfRangeException(), }; var crewAll = RobustRandom.Prob(0.5f) ? crew2 : Loc.GetString("ion-storm-crew"); var objectsThreats = RobustRandom.Prob(0.5f) ? objects : threats; diff --git a/Content.Server/StationRecords/Systems/StationRecordsSystem.cs b/Content.Server/StationRecords/Systems/StationRecordsSystem.cs index 8c8ba7132b..c7d5665464 100644 --- a/Content.Server/StationRecords/Systems/StationRecordsSystem.cs +++ b/Content.Server/StationRecords/Systems/StationRecordsSystem.cs @@ -343,6 +343,7 @@ public sealed class StationRecordsSystem : SharedStationRecordsSystem && IsFilterWithSomeCodeValue(someRecord.Fingerprint, filterLowerCaseValue), StationRecordFilterType.DNA => someRecord.DNA != null && IsFilterWithSomeCodeValue(someRecord.DNA, filterLowerCaseValue), + _ => throw new IndexOutOfRangeException(nameof(filter.Type)), }; }