summaryrefslogtreecommitdiffstats
path: root/sigmod/Item.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-12-26 12:20:08 -0500
committerBen Boeckel <MathStuf@gmail.com>2008-12-26 12:20:08 -0500
commitb7d4eb0356e9a1037a1599177cedefd4b2614e1d (patch)
tree16fe20f3b8cddb6a285d83f61474b824d5f773a6 /sigmod/Item.cpp
parentd88d93e1e0d0d80b7c4f741a03bfe5b1976e930a (diff)
Added convenience macro for simple bounds checking
Diffstat (limited to 'sigmod/Item.cpp')
-rw-r--r--sigmod/Item.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/sigmod/Item.cpp b/sigmod/Item.cpp
index 4f426bfe..172660a8 100644
--- a/sigmod/Item.cpp
+++ b/sigmod/Item.cpp
@@ -124,12 +124,8 @@ GETTER(Item, Sigcore::Script, script)
CHECK(Item, QString&, name)
CHECK(Item, bool, sellable)
CHECK_INDEX(Item, int, type, sigmod(), type)
-CHECK_BEGIN(Item, int, price)
- TBOUNDS(price, 1, sigmod()->rules()->maxMoney())
-CHECK_END()
-CHECK_BEGIN(Item, int, sellPrice)
- TBOUNDS(sellPrice, 0, m_price)
-CHECK_END()
+CHECK_BOUNDS(Item, int, price, 1, sigmod()->rules()->maxMoney())
+CHECK_BOUNDS(Item, int, sellPrice, 0, m_price)
CHECK_BEGIN(Item, int, weight)
const ItemType* type = sigmod()->itemTypeById(m_type);
if (type)