diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-12-25 07:53:09 -0500 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-12-25 07:53:09 -0500 |
| commit | f3b3f21d3ba0fd48bc265684817cb38a70adf84b (patch) | |
| tree | ccffe66f71e3ee15166080cda2aca7d842f547a2 /sigmod/Item.cpp | |
| parent | e88f1843d61fd0d4c02fa85c3444c786f8c8fd8d (diff) | |
Bounds errors are verbose now and some unchecked conditions fixed as well
Diffstat (limited to 'sigmod/Item.cpp')
| -rw-r--r-- | sigmod/Item.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sigmod/Item.cpp b/sigmod/Item.cpp index 135590bc..af96cb60 100644 --- a/sigmod/Item.cpp +++ b/sigmod/Item.cpp @@ -116,7 +116,7 @@ void Sigmod::Item::setSellable(const bool sellable) void Sigmod::Item::setType(const int type) { if (!sigmod()->itemTypeById(type)) - emit(error(bounds("type"))); + emit(error(bounds("type", type))); else CHECK(type); } @@ -124,7 +124,7 @@ void Sigmod::Item::setType(const int type) void Sigmod::Item::setPrice(const int price) { if ((price <= 0) || (sigmod()->rules()->maxMoney() < price)) - emit(error(bounds("price"))); + emit(error(bounds("price", 1, sigmod()->rules()->maxMoney(), price))); else CHECK(price); } @@ -132,7 +132,7 @@ void Sigmod::Item::setPrice(const int price) void Sigmod::Item::setSellPrice(const int sellPrice) { if ((sellPrice < 0) || (m_price < sellPrice)) - emit(error(bounds("sellPrice"))); + emit(error(bounds("sellPrice", 0, m_price, sellPrice))); else CHECK(sellPrice); } @@ -143,7 +143,7 @@ void Sigmod::Item::setWeight(const int weight) if (type) { if ((weight < 0) || (type->maxWeight() < weight)) - emit(error(bounds("weight"))); + emit(error(bounds("weight", 0, type->maxWeight(), weight))); else CHECK(weight); } |
