Fix SAV3 party & info loading

forgot 0x1000
This commit is contained in:
Kaphotics 2016-07-04 23:52:37 -07:00
parent 55d89952dd
commit edc9bb7046
2 changed files with 6 additions and 9 deletions

View file

@ -53,11 +53,7 @@ namespace PKHeX
for (int i = 0; i < 14; i++)
BlockOrder[i] = BitConverter.ToInt16(Data, ABO + i*0x1000 + 0xFF4);
for (int i = 0; i < 14; i++)
BlockOfs[i] = Array.IndexOf(BlockOrder, i) + ABO;
// Detect RS/E/FRLG
// Section 0 stores Game Code @ 0x00AC; 0 for RS, 1 for FRLG, else for Emerald
BlockOfs[i] = Array.IndexOf(BlockOrder, i)*0x1000 + ABO;
// Set up PC data buffer beyond end of save file.
Box = Data.Length;
@ -113,11 +109,10 @@ namespace PKHeX
resetBoxes();
}
private readonly int[] BlockOfs;
private readonly int ActiveSAV;
private int ABO => ActiveSAV*0xE000;
private readonly int[] BlockOrder;
private readonly int[] BlockOfs;
// Configuration
public override SaveFile Clone() { return new SAV3(Data.Take(Box).ToArray(), Version); }
@ -140,7 +135,9 @@ namespace PKHeX
protected override int GiftCountMax => 1;
public override int OTLength => 8;
public override int NickLength => 10;
public override bool HasParty => true;
// Checksums
protected override void setChecksums()
{

View file

@ -68,7 +68,7 @@ namespace PKHeX
public bool HasOPower => OPower > -1;
public bool HasJPEG => JPEGData != null;
public bool HasBox => Box > -1;
public bool HasParty => Party > -1;
public virtual bool HasParty => Party > -1;
public bool HasBattleBox => BattleBox > -1;
public bool HasFused => Fused > -1;
public bool HasGTS => GTS > -1;