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/AbilityEffect.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/AbilityEffect.cpp')
| -rw-r--r-- | pokemod/AbilityEffect.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pokemod/AbilityEffect.cpp b/pokemod/AbilityEffect.cpp index 382ccf39..2b571fe4 100644 --- a/pokemod/AbilityEffect.cpp +++ b/pokemod/AbilityEffect.cpp @@ -231,8 +231,10 @@ QDomElement AbilityEffect::save() const return xml; } -void AbilityEffect::setChance(const Fraction& chance) throw(Exception) +void AbilityEffect::setChance(const Fraction& chance) throw(BoundsException) { + if (1 < chance) + error<BoundsException>("chance"); m_chance = chance; } @@ -379,7 +381,7 @@ void AbilityEffect::setTriggerValue1(const int triggerValue1) throw(Exception) m_triggerValue1 = triggerValue1; } -void AbilityEffect::setTriggerValue2(const Fraction& triggerValue2) throw(Exception) +void AbilityEffect::setTriggerValue2(const Fraction& triggerValue2) throw(UnusedException) { if (m_trigger != T_HPBoundary) error<UnusedException>("triggerValue2"); |
