From 56fbc43a58611ff35f7a5d2e1306dd117fb1872c Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Tue, 3 May 2016 11:01:17 -0700 Subject: [PATCH] Bugfixing. --- Rhydon/ItemList.cs | 2 +- Rhydon/PK1.cs | 10 +++++++++- Rhydon/Tables.cs | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Rhydon/ItemList.cs b/Rhydon/ItemList.cs index 373dbd0..752f4ac 100644 --- a/Rhydon/ItemList.cs +++ b/Rhydon/ItemList.cs @@ -42,7 +42,7 @@ public int getCount() public void updateCount() { int count = 0; - while (this[count].Index != 0 && count < Capacity) + while (count < Capacity && this[count].Index != 0) count++; Count = count; } diff --git a/Rhydon/PK1.cs b/Rhydon/PK1.cs index 6febf37..91c4117 100644 --- a/Rhydon/PK1.cs +++ b/Rhydon/PK1.cs @@ -41,7 +41,15 @@ public PK1 Clone() public byte Species { get { return Data[0]; } - set { Data[0] = value; } + set + { + if (value < byte.MinValue || value > byte.MaxValue) + return; + Data[0] = value; + Type_A = (byte)Tables.ID_To_Base_Stats[value][5]; + Type_B = (byte)Tables.ID_To_Base_Stats[value][6]; + Catch_Rate = (byte)Tables.ID_To_Base_Stats[value][7]; + } } public ushort HP_Current { diff --git a/Rhydon/Tables.cs b/Rhydon/Tables.cs index 7e7bfe3..22bcbe7 100644 --- a/Rhydon/Tables.cs +++ b/Rhydon/Tables.cs @@ -498,7 +498,7 @@ internal static uint getEXP(int level, int species) {1000000, 600000, 1640000, 1059860, 800000, 1250000}, }; - public static readonly int[] movePPs = { 35, 25, 10, 15, 20, 20, 15, 15, 15, 35, 30, 5, 10, 30, 30, 35, 35, 20, 15, 20, 20, 10, 20, 30, 5, 25, 15, 15, 15, 25, 20, 5, 35, 15, 20, 20, 20, 15, 30, 35, 20, 20, 30, 25, 40, 20, 15, 20, 20, 20, 30, 25, 15, 30, 25, 5, 15, 10, 5, 20, 20, 20, 5, 35, 20, 25, 20, 20, 20, 15, 20, 10, 10, 40, 25, 10, 35, 30, 15, 20, 40, 10, 15, 30, 15, 20, 10, 15, 10, 5, 10, 10, 25, 10, 20, 40, 30, 30, 20, 20, 15, 10, 40, 15, 20, 30, 20, 20, 10, 40, 40, 30, 30, 30, 20, 30, 10, 10, 20, 5, 10, 30, 20, 20, 20, 5, 15, 10, 20, 15, 15, 35, 20, 15, 10, 20, 30, 15, 40, 20, 15, 10, 5, 10, 30, 10, 15, 20, 15, 40, 40, 10, 5, 15, 10, 10, 10, 15, 30, 30, 10, 10, 20, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + public static readonly int[] movePPs = { 0, 35, 25, 10, 15, 20, 20, 15, 15, 15, 35, 30, 5, 10, 30, 30, 35, 35, 20, 15, 20, 20, 10, 20, 30, 5, 25, 15, 15, 15, 25, 20, 5, 35, 15, 20, 20, 20, 15, 30, 35, 20, 20, 30, 25, 40, 20, 15, 20, 20, 20, 30, 25, 15, 30, 25, 5, 15, 10, 5, 20, 20, 20, 5, 35, 20, 25, 20, 20, 20, 15, 20, 10, 10, 40, 25, 10, 35, 30, 15, 20, 40, 10, 15, 30, 15, 20, 10, 15, 10, 5, 10, 10, 25, 10, 20, 40, 30, 30, 20, 20, 15, 10, 40, 15, 20, 30, 20, 20, 10, 40, 40, 30, 30, 30, 20, 30, 10, 10, 20, 5, 10, 30, 20, 20, 20, 5, 15, 10, 20, 15, 15, 35, 20, 15, 10, 20, 30, 15, 40, 20, 15, 10, 5, 10, 30, 10, 15, 20, 15, 40, 40, 10, 5, 15, 10, 10, 10, 15, 30, 30, 10, 10, 20, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; public static int getMovePP(int move, int ppup) {