From 56ba92b68b0df72f8f06d09cd38f752c485d739f Mon Sep 17 00:00:00 2001 From: Kurt Date: Thu, 19 Mar 2026 15:39:07 -0500 Subject: [PATCH] Handle ZA's EOL revision (2) When throwing arg out of range, pass the value so it's obvious the number --- PKHeX.Core/Saves/SAV8LA.cs | 2 +- PKHeX.Core/Saves/SAV8SWSH.cs | 4 ++-- PKHeX.Core/Saves/SAV9SV.cs | 4 ++-- PKHeX.Core/Saves/SAV9ZA.cs | 3 ++- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/PKHeX.Core/Saves/SAV8LA.cs b/PKHeX.Core/Saves/SAV8LA.cs index eda68c5e5..c4f86509e 100644 --- a/PKHeX.Core/Saves/SAV8LA.cs +++ b/PKHeX.Core/Saves/SAV8LA.cs @@ -36,7 +36,7 @@ public SAV8LA() { 0 => "-Base", // Vanilla 1 => "-DB", // DLC 1: Daybreak - _ => throw new ArgumentOutOfRangeException(nameof(SaveRevision)), + _ => throw new ArgumentOutOfRangeException(nameof(SaveRevision), SaveRevision, null), }; public override string GetString(ReadOnlySpan data) diff --git a/PKHeX.Core/Saves/SAV8SWSH.cs b/PKHeX.Core/Saves/SAV8SWSH.cs index f4ed27474..0e6a3327f 100644 --- a/PKHeX.Core/Saves/SAV8SWSH.cs +++ b/PKHeX.Core/Saves/SAV8SWSH.cs @@ -45,7 +45,7 @@ public override void CopyChangesFrom(SaveFile sav) 0 => "-Base", // Vanilla 1 => "-IoA", // DLC 1: Isle of Armor 2 => "-CT", // DLC 2: Crown Tundra - _ => throw new ArgumentOutOfRangeException(nameof(SaveRevision)), + _ => throw new ArgumentOutOfRangeException(nameof(SaveRevision), SaveRevision, null), }; public override bool ChecksumsValid => true; @@ -111,7 +111,7 @@ private void Initialize() 0 => (Legal.MaxMoveID_8_O0, Legal.MaxSpeciesID_8_O0, Legal.MaxItemID_8_O0, Legal.MaxAbilityID_8_O0), 1 => (Legal.MaxMoveID_8_R1, Legal.MaxSpeciesID_8_R1, Legal.MaxItemID_8_R1, Legal.MaxAbilityID_8_R1), 2 => (Legal.MaxMoveID_8_R2, Legal.MaxSpeciesID_8_R2, Legal.MaxItemID_8_R2, Legal.MaxAbilityID_8_R2), - _ => throw new ArgumentOutOfRangeException(nameof(SaveRevision)), + _ => throw new ArgumentOutOfRangeException(nameof(SaveRevision), SaveRevision, null), }; } diff --git a/PKHeX.Core/Saves/SAV9SV.cs b/PKHeX.Core/Saves/SAV9SV.cs index 1e8f1e0f8..b141d4c46 100644 --- a/PKHeX.Core/Saves/SAV9SV.cs +++ b/PKHeX.Core/Saves/SAV9SV.cs @@ -50,7 +50,7 @@ public override void CopyChangesFrom(SaveFile sav) 0 => "-Base", // Vanilla 1 => "-TM", // Teal Mask 2 => "-ID", // Indigo Disk - _ => throw new ArgumentOutOfRangeException(nameof(SaveRevision)), + _ => throw new ArgumentOutOfRangeException(nameof(SaveRevision), SaveRevision, null), }; public override bool ChecksumsValid => true; @@ -118,7 +118,7 @@ private void Initialize() 0 => (Legal.MaxMoveID_9_T0, Legal.MaxSpeciesID_9_T0, Legal.MaxItemID_9_T0, Legal.MaxAbilityID_9_T0), 1 => (Legal.MaxMoveID_9_T1, Legal.MaxSpeciesID_9_T1, Legal.MaxItemID_9_T1, Legal.MaxAbilityID_9_T1), 2 => (Legal.MaxMoveID_9_T2, Legal.MaxSpeciesID_9_T2, Legal.MaxItemID_9_T2, Legal.MaxAbilityID_9_T2), - _ => throw new ArgumentOutOfRangeException(nameof(SaveRevision)), + _ => throw new ArgumentOutOfRangeException(nameof(SaveRevision), SaveRevision, null), }; } diff --git a/PKHeX.Core/Saves/SAV9ZA.cs b/PKHeX.Core/Saves/SAV9ZA.cs index 499e9704f..4fe4654f2 100644 --- a/PKHeX.Core/Saves/SAV9ZA.cs +++ b/PKHeX.Core/Saves/SAV9ZA.cs @@ -48,7 +48,8 @@ public override void CopyChangesFrom(SaveFile sav) { 0 => "-Base", // Vanilla 1 => "-MD", // Mega Dimension - _ => throw new ArgumentOutOfRangeException(nameof(SaveRevision)), + 2 => "-EOL", // End of Life + _ => throw new ArgumentOutOfRangeException(nameof(SaveRevision), SaveRevision, null), }; public override bool ChecksumsValid => true;