Skip to content
This repository has been archived by the owner on Jan 16, 2020. It is now read-only.

Commit

Permalink
Fix bugs with PPups and party whitescreening.
Browse files Browse the repository at this point in the history
  • Loading branch information
SciresM committed Apr 30, 2016
1 parent 4e63ec0 commit 377e143
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Rhydon/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ private void updateMovesPPs(object sender, EventArgs e)
else
{
int ind = Math.Max(Array.IndexOf(moveBoxs, sender as ComboBox), Array.IndexOf(PPus, sender as ComboBox));
int PP = Tables.getMovePP((int)moveBoxs[ind].SelectedValue, PPus[ind].SelectedIndex);
int PP = Tables.getMovePP(pk1.Moves[ind], pk1.PPUPs[ind]);

PPs[ind].Text = PP.ToString();
pk1.setPP(ind, (byte)PP);
Expand Down
16 changes: 8 additions & 8 deletions Rhydon/PK1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public byte PP_1
public byte PPUP_1
{
get { return (byte)((Data[0x1D] & 0xC0) >> 6); }
set { Data[0x1D] = (byte)((Data[0x1D] & 0x3F) | ((value & 0x3) >> 6)); }
set { Data[0x1D] = (byte)((Data[0x1D] & 0x3F) | ((value & 0x3) << 6)); }
}

public byte PP_2
Expand All @@ -194,7 +194,7 @@ public byte PP_2
public byte PPUP_2
{
get { return (byte)((Data[0x1E] & 0xC0) >> 6); }
set { Data[0x1E] = (byte)((Data[0x1E] & 0x3F) | ((value & 0x3) >> 6)); }
set { Data[0x1E] = (byte)((Data[0x1E] & 0x3F) | ((value & 0x3) << 6)); }
}

public byte PP_3
Expand All @@ -206,7 +206,7 @@ public byte PP_3
public byte PPUP_3
{
get { return (byte)((Data[0x1F] & 0xC0) >> 6); }
set { Data[0x1F] = (byte)((Data[0x1F] & 0x3F) | ((value & 0x3) >> 6)); }
set { Data[0x1F] = (byte)((Data[0x1F] & 0x3F) | ((value & 0x3) << 6)); }
}

public byte PP_4
Expand All @@ -218,7 +218,7 @@ public byte PP_4
public byte PPUP_4
{
get { return (byte)((Data[0x20] & 0xC0) >> 6); }
set { Data[0x20] = (byte)((Data[0x20] & 0x3F) | ((value & 0x3) >> 6)); }
set { Data[0x20] = (byte)((Data[0x20] & 0x3F) | ((value & 0x3) << 6)); }
}

// Party Only
Expand Down Expand Up @@ -322,10 +322,10 @@ public byte[] PPUPs
set
{
if (value == null || value.Length != 4) return;
PPUP_1 = Math.Max(value[0], (byte)3);
PPUP_2 = Math.Max(value[1], (byte)3);
PPUP_3 = Math.Max(value[2], (byte)3);
PPUP_4 = Math.Max(value[3], (byte)3);
PPUP_1 = Math.Min(value[0], (byte)3);
PPUP_2 = Math.Min(value[1], (byte)3);
PPUP_3 = Math.Min(value[2], (byte)3);
PPUP_4 = Math.Min(value[3], (byte)3);
}
}

Expand Down
1 change: 1 addition & 0 deletions Rhydon/PokemonList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ private void Update()
Array.Copy(Pokemon[i].OT_Name, 0, Data, 2 + Capacity + Capacity * Entry_Size + 0xB * i, 0xB);
Array.Copy(Pokemon[i].Nickname, 0, Data, 2 + Capacity + Capacity * Entry_Size + 0xB * Capacity + 0xB * i, 0xB);
}
Data[1 + Count] = byte.MaxValue;
}

public byte[] GetBytes()
Expand Down

0 comments on commit 377e143

Please sign in to comment.