Skip to content

Commit

Permalink
Added bounds check to deductPp.
Browse files Browse the repository at this point in the history
  • Loading branch information
cathyjf committed Oct 8, 2010
1 parent 20eb0da commit dacfd27
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/shoddybattle/Pokemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1026,6 +1026,9 @@ void Pokemon::setPp(const int i, const int pp) {
* Deduct PP from a move slot.
*/
void Pokemon::deductPp(const int i) {
if ((i < 0) || (i >= m_pp.size())) {
return;
}
setPp(i, m_pp[i] - 1);
m_moveUsed[i] = true;
}
Expand Down

0 comments on commit dacfd27

Please sign in to comment.