From b7d4eb0356e9a1037a1599177cedefd4b2614e1d Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 26 Dec 2008 12:20:08 -0500 Subject: Added convenience macro for simple bounds checking --- sigmod/Item.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'sigmod/Item.cpp') 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) -- cgit