From 769d5d86897396d4c5a1cfadd58e030f513eec60 Mon Sep 17 00:00:00 2001 From: Kurt Date: Wed, 30 Sep 2020 12:44:50 -0700 Subject: [PATCH] Allow SaveFile constructor to specify exportable state Useful for partially-supported savefiles that can't be exported yet (Stadium) --- PKHeX.Core/Saves/SAV1Stadium.cs | 6 +++--- PKHeX.Core/Saves/SaveFile.cs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/PKHeX.Core/Saves/SAV1Stadium.cs b/PKHeX.Core/Saves/SAV1Stadium.cs index 5d867072f..f551d9d7c 100644 --- a/PKHeX.Core/Saves/SAV1Stadium.cs +++ b/PKHeX.Core/Saves/SAV1Stadium.cs @@ -70,7 +70,7 @@ namespace PKHeX.Core public SAV1Stadium(byte[] data) : this(data, IsStadiumJ(data)) { } - public SAV1Stadium(byte[] data, bool japanese) : base(data) + public SAV1Stadium(byte[] data, bool japanese) : base(data, false) { Japanese = japanese; Box = 0; @@ -113,7 +113,7 @@ namespace PKHeX.Core for (int i = 0; i < 10; i++) { - if (BitConverter.ToUInt32(data, 0x15A + (i * SAV1Stadium.TeamSizeU)) != 0x454B4F50) // POKE + if (BitConverter.ToUInt32(data, 0x15A + (i * TeamSizeU)) != 0x454B4F50) // POKE return false; } return true; @@ -126,7 +126,7 @@ namespace PKHeX.Core for (int i = 0; i < 10; i++) { - if (BitConverter.ToUInt32(data, 0x122 + (i * SAV1Stadium.TeamSizeJ)) != 0x454B4F50) // POKE + if (BitConverter.ToUInt32(data, 0x122 + (i * TeamSizeJ)) != 0x454B4F50) // POKE return false; } return true; diff --git a/PKHeX.Core/Saves/SaveFile.cs b/PKHeX.Core/Saves/SaveFile.cs index f259a09e7..175b2eed1 100644 --- a/PKHeX.Core/Saves/SaveFile.cs +++ b/PKHeX.Core/Saves/SaveFile.cs @@ -16,14 +16,14 @@ namespace PKHeX.Core public readonly bool Exportable; public readonly byte[] BAK; - protected SaveFile(byte[] data, byte[] bak) + protected SaveFile(byte[] data, byte[] bak, bool exportable = true) { Data = data; BAK = bak; - Exportable = true; + Exportable = exportable; } - protected SaveFile(byte[] data) : this(data, (byte[])data.Clone()) { } + protected SaveFile(byte[] data, bool exportable = true) : this(data, (byte[])data.Clone(), exportable) { } protected SaveFile() {