]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix warnings related to non-exhaustive pattern matching. (#31763)
authorMervill <mervills.email@gmail.com>
Mon, 2 Sep 2024 21:50:35 +0000 (14:50 -0700)
committerGitHub <noreply@github.com>
Mon, 2 Sep 2024 21:50:35 +0000 (17:50 -0400)
old man shakes fist at modern syntax

Content.Server/ParticleAccelerator/EntitySystems/ParticleAcceleratorSystem.ControlBox.cs
Content.Server/StationEvents/Events/IonStormRule.cs
Content.Server/StationRecords/Systems/StationRecordsSystem.cs

index 17943c1c9878805c992ffff207e38bbf375e1b97..404eb00fef26c226fd771c40607487deff6a6f1a 100644 (file)
@@ -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}");
index b20b81822f32f30aff6bb81bdeac6f0bb74aa053..7a959eb1e35667d75f64446187f0d147ab4721db 100644 (file)
@@ -200,7 +200,8 @@ public sealed class IonStormRule : StationEventSystem<IonStormRuleComponent>
         {
             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;
index 8c8ba7132bb54d6823d30a2ec897c39fa384c8df..c7d5665464674a1398fb7e3ba47e4b0f6f80d02d 100644 (file)
@@ -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)),
         };
     }