diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-04-20 00:12:12 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-04-20 00:12:12 +0000 |
| commit | dcb77408505e5fb40f064dd05aaf39f27dcdd524 (patch) | |
| tree | c9de6f2a58d754511b7c821db58f8c0e881a0e1f /pokemod/Rules.cpp | |
| parent | f4f3176a6dcdaf5e463f39a657dd4ca04386a6ad (diff) | |
[FIX] Fraction bounds checking
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@102 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod/Rules.cpp')
| -rw-r--r-- | pokemod/Rules.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pokemod/Rules.cpp b/pokemod/Rules.cpp index ab4b465e..1f9b804d 100644 --- a/pokemod/Rules.cpp +++ b/pokemod/Rules.cpp @@ -333,8 +333,10 @@ void Rules::setMaxEVPerStat(const int maxEVPerStat) throw(BoundsException) m_maxEVPerStat = maxEVPerStat; } -void Rules::setPokerusChance(const Fraction& pokerusChance) throw(Exception) +void Rules::setPokerusChance(const Fraction& pokerusChance) throw(BoundsException) { + if (1 < pokerusChance) + error<BoundsException>("pokerusChance"); m_pokerusChance = pokerusChance; } |
