From b68e9472cbe891ee600bf78e419ae2a0c9a7997d Mon Sep 17 00:00:00 2001 From: Kurt Date: Thu, 12 Mar 2020 15:05:59 -0700 Subject: [PATCH] Break apart value fetch -> compare easier to debug --- PKHeX.Core/Saves/SAV4.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PKHeX.Core/Saves/SAV4.cs b/PKHeX.Core/Saves/SAV4.cs index caab029fa..47fd480e5 100644 --- a/PKHeX.Core/Saves/SAV4.cs +++ b/PKHeX.Core/Saves/SAV4.cs @@ -165,7 +165,9 @@ private static int GetActiveBlock(byte[] data, int begin, int length) private static int GetActiveBlockViaCounter(byte[] data, int begin, int length) { int ofs = GetBlockSaveCounterOffset(begin, length); - bool first = BitConverter.ToUInt16(data, ofs) >= BitConverter.ToUInt16(data, ofs + PartitionSize); + var block0 = BitConverter.ToUInt16(data, ofs); + var block1 = BitConverter.ToUInt16(data, ofs + PartitionSize); + bool first = block0 >= block1; return first ? 0 : 1; }