mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-08-28 06:10:07 -05:00
Add RS & FRLG mail offsets
was only emerald prior Thansk @Bl4ckSh4rk ! https://projectpokemon.org/home/forums/topic/44433-bug-rubysapphire-mailbox/?do=findComment&comment=228885
This commit is contained in:
@@ -9,9 +9,30 @@ public class Mail3 : Mail
|
||||
|
||||
public Mail3(SAV3 sav, int index)
|
||||
{
|
||||
DataOffset = index * SIZE + sav.GetBlockOffset(3) + 0xCE0;
|
||||
GetMailBlockOffset(sav.Version, index, out int block, out int offset);
|
||||
DataOffset = index * SIZE + sav.GetBlockOffset(block) + offset;
|
||||
Data = sav.GetData(DataOffset, SIZE);
|
||||
}
|
||||
|
||||
private static void GetMailBlockOffset(GameVersion game, int index, out int block, out int offset)
|
||||
{
|
||||
block = 3;
|
||||
if (game == GameVersion.E)
|
||||
offset = 0xCE0;
|
||||
else if (GameVersion.RS.Contains(game))
|
||||
offset = 0xC4C;
|
||||
else // FRLG
|
||||
{
|
||||
if (index >= 12)
|
||||
{
|
||||
block = 4;
|
||||
offset = 0;
|
||||
}
|
||||
else
|
||||
offset = 0xDD0;
|
||||
}
|
||||
}
|
||||
|
||||
public Mail3()
|
||||
{
|
||||
Data = new byte[SIZE];
|
||||
|
||||
Reference in New Issue
Block a user