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:
Kurt
2018-03-23 23:06:51 -07:00
parent 17b771632e
commit c229d5cef4

View File

@@ -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];