summaryrefslogtreecommitdiffstats
path: root/sigmod/Item.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-12-25 09:40:50 -0500
committerBen Boeckel <MathStuf@gmail.com>2008-12-25 09:40:50 -0500
commit43992b51a31067f2168b46f18758f9cc50371165 (patch)
tree06478435610503dc9118bd2443b51ef6a5a45696 /sigmod/Item.cpp
parentf859e3785e392135d144b2ddea6c67030aa9ebba (diff)
Additional check in Item for setting sellPrice if the item is not sellable
Diffstat (limited to 'sigmod/Item.cpp')
-rw-r--r--sigmod/Item.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/sigmod/Item.cpp b/sigmod/Item.cpp
index e6f521dd..5d43ad42 100644
--- a/sigmod/Item.cpp
+++ b/sigmod/Item.cpp
@@ -131,6 +131,11 @@ void Sigmod::Item::setPrice(const int price)
void Sigmod::Item::setSellPrice(const int sellPrice)
{
+ if (!m_sellable)
+ {
+ emit(error("Item is not sellable"));
+ return;
+ }
if ((sellPrice < 0) || (m_price < sellPrice))
emit(error(bounds("sellPrice", 0, m_price, sellPrice)));
else