summaryrefslogtreecommitdiffstats
path: root/sigmod/Move.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-12-25 07:53:09 -0500
committerBen Boeckel <MathStuf@gmail.com>2008-12-25 07:53:09 -0500
commitf3b3f21d3ba0fd48bc265684817cb38a70adf84b (patch)
treeccffe66f71e3ee15166080cda2aca7d842f547a2 /sigmod/Move.cpp
parente88f1843d61fd0d4c02fa85c3444c786f8c8fd8d (diff)
downloadsigen-f3b3f21d3ba0fd48bc265684817cb38a70adf84b.tar.gz
sigen-f3b3f21d3ba0fd48bc265684817cb38a70adf84b.tar.xz
sigen-f3b3f21d3ba0fd48bc265684817cb38a70adf84b.zip
Bounds errors are verbose now and some unchecked conditions fixed as well
Diffstat (limited to 'sigmod/Move.cpp')
-rw-r--r--sigmod/Move.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/sigmod/Move.cpp b/sigmod/Move.cpp
index 6d7a3aa0..76fdc7f3 100644
--- a/sigmod/Move.cpp
+++ b/sigmod/Move.cpp
@@ -116,8 +116,8 @@ void Sigmod::Move::setName(const QString& name)
void Sigmod::Move::setAccuracy(const Sigcore::Fraction& accuracy)
{
- if (!accuracy || (1 < accuracy))
- emit(error(bounds("accuracy")));
+ if ((accuracy < 0) || (1 < accuracy))
+ emit(error(bounds("accuracy", 0, 1, accuracy)));
else
CHECK(accuracy);
}
@@ -130,7 +130,7 @@ void Sigmod::Move::setPower(const int power)
void Sigmod::Move::setType(const int type)
{
if (!sigmod()->typeById(type))
- emit(error(bounds("type")));
+ emit(error(bounds("type", type)));
else
CHECK(type);
}
@@ -142,8 +142,8 @@ void Sigmod::Move::setSpecial(const bool special)
void Sigmod::Move::setPowerPoints(const int powerPoints)
{
- if (!powerPoints)
- emit(error(bounds("powerPoints")));
+ if (powerPoints <= 0)
+ emit(error(bounds("powerPoints", 1, INT_MAX, powerPoints)));
else
CHECK(powerPoints);
}