diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-12-24 04:13:28 -0500 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-12-24 04:13:28 -0500 |
| commit | c6997855c732df4e99cfe2b91da88c43270186f5 (patch) | |
| tree | 58d78a09dd3832a36e3f857e6a7e7cc354c92962 /sigmod/Badge.cpp | |
| parent | 9fa1ef9c17127f8f42578b5663f08ccd051acd90 (diff) | |
| download | sigen-c6997855c732df4e99cfe2b91da88c43270186f5.tar.gz sigen-c6997855c732df4e99cfe2b91da88c43270186f5.tar.xz sigen-c6997855c732df4e99cfe2b91da88c43270186f5.zip | |
Added a validation measure and formatting in setObey
Diffstat (limited to 'sigmod/Badge.cpp')
| -rw-r--r-- | sigmod/Badge.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sigmod/Badge.cpp b/sigmod/Badge.cpp index 92d60090..a3931a8b 100644 --- a/sigmod/Badge.cpp +++ b/sigmod/Badge.cpp @@ -69,6 +69,8 @@ void Sigmod::Badge::validate() emit(error("Name is empty")); TEST(setFace, face); TEST(setBadge, badge); + if (m_face == m_badge) + emit(error("Face and badge sprites are the same")); TEST(setObey, obey); TEST_ARRAY(setStat, stat, ST_SpecialDefense - ST_Attack + 1); TEST_END(); @@ -119,11 +121,9 @@ void Sigmod::Badge::setBadge(const int badge) void Sigmod::Badge::setObey(const int obey) { if (sigmod()->rules()->maxLevel() < obey) - { emit(error(bounds("obey"))); - return; - } - CHECK(obey); + else + CHECK(obey); } void Sigmod::Badge::setStat(const Stat stat, const Sigcore::Fraction& multiplier) |
