From c6997855c732df4e99cfe2b91da88c43270186f5 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Wed, 24 Dec 2008 04:13:28 -0500 Subject: Added a validation measure and formatting in setObey --- sigmod/Badge.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sigmod/Badge.cpp') 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) -- cgit