Fix daycare reading

Finally got around to checking this, wasn't too far off.
This commit is contained in:
Kurt 2016-11-13 19:36:39 -08:00
parent b9bf2ff709
commit 4eb643db37

View File

@ -654,7 +654,7 @@ public override int getDaycareSlotOffset(int loc, int slot)
return -1;
if (Daycare < 0)
return -1;
return Daycare + 6 + slot * (SIZE_STORED + 6);
return Daycare + 1 + slot * (SIZE_STORED + 1);
}
public override bool? getDaycareOccupied(int loc, int slot)
{
@ -663,7 +663,7 @@ public override int getDaycareSlotOffset(int loc, int slot)
if (Daycare < 0)
return null;
return Data[Daycare + (SIZE_STORED + 6) * slot] != 0;
return Data[Daycare + (SIZE_STORED + 1) * slot] != 0;
}
public override string getDaycareRNGSeed(int loc)
{
@ -682,7 +682,7 @@ public override string getDaycareRNGSeed(int loc)
if (Daycare < 0)
return null;
return Data[Daycare + 0x1E0] == 1;
return Data[Daycare + 0x1D8] == 1;
}
public override void setDaycareOccupied(int loc, int slot, bool occupied)
{
@ -690,9 +690,8 @@ public override void setDaycareOccupied(int loc, int slot, bool occupied)
return;
if (Daycare < 0)
return;
// Are they using species instead of a flag?
Data[Daycare + (SIZE_STORED + 6) * slot] = (byte)(occupied ? 1 : 0);
Data[Daycare + (SIZE_STORED + 1) * slot] = (byte)(occupied ? 1 : 0);
}
public override void setDaycareRNGSeed(int loc, string seed)
{
@ -718,7 +717,7 @@ public override void setDaycareHasEgg(int loc, bool hasEgg)
if (Daycare < 0)
return;
Data[Daycare + 0x1E0] = (byte)(hasEgg ? 1 : 0);
Data[Daycare + 0x1D8] = (byte)(hasEgg ? 1 : 0);
}
// Mystery Gift