diff options
author | Haru <haru@dotalux.com> | 2014-05-31 02:55:46 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2014-05-31 02:55:46 +0200 |
commit | 3dccf7e300f9868a98075e1863c88c38d3211f33 (patch) | |
tree | f21e1cccc81a5fde15627bbcea45c817599cab06 /src/map/itemdb.c | |
parent | cadd6115604d80158fc532eb23209975cebf334a (diff) | |
download | hercules-3dccf7e300f9868a98075e1863c88c38d3211f33.tar.gz hercules-3dccf7e300f9868a98075e1863c88c38d3211f33.tar.bz2 hercules-3dccf7e300f9868a98075e1863c88c38d3211f33.tar.xz hercules-3dccf7e300f9868a98075e1863c88c38d3211f33.zip |
Added ItemTradeRestriction enum
- To be used in a follow-up item_db.conf edit.
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/itemdb.c')
-rw-r--r-- | src/map/itemdb.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/map/itemdb.c b/src/map/itemdb.c index 320c64402..a2b1f97ba 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -521,39 +521,39 @@ int itemdb_isstackable2(struct item_data *data) * Trade Restriction functions [Skotlex] *------------------------------------------*/ int itemdb_isdropable_sub(struct item_data *item, int gmlv, int unused) { - return (item && (!(item->flag.trade_restriction&1) || gmlv >= item->gm_lv_trade_override)); + return (item && (!(item->flag.trade_restriction&ITR_NODROP) || gmlv >= item->gm_lv_trade_override)); } int itemdb_cantrade_sub(struct item_data* item, int gmlv, int gmlv2) { - return (item && (!(item->flag.trade_restriction&2) || gmlv >= item->gm_lv_trade_override || gmlv2 >= item->gm_lv_trade_override)); + return (item && (!(item->flag.trade_restriction&ITR_NOTRADE) || gmlv >= item->gm_lv_trade_override || gmlv2 >= item->gm_lv_trade_override)); } int itemdb_canpartnertrade_sub(struct item_data* item, int gmlv, int gmlv2) { - return (item && (item->flag.trade_restriction&4 || gmlv >= item->gm_lv_trade_override || gmlv2 >= item->gm_lv_trade_override)); + return (item && (item->flag.trade_restriction&ITR_PARTNEROVERRIDE || gmlv >= item->gm_lv_trade_override || gmlv2 >= item->gm_lv_trade_override)); } int itemdb_cansell_sub(struct item_data* item, int gmlv, int unused) { - return (item && (!(item->flag.trade_restriction&8) || gmlv >= item->gm_lv_trade_override)); + return (item && (!(item->flag.trade_restriction&ITR_NOSELLTONPC) || gmlv >= item->gm_lv_trade_override)); } int itemdb_cancartstore_sub(struct item_data* item, int gmlv, int unused) { - return (item && (!(item->flag.trade_restriction&16) || gmlv >= item->gm_lv_trade_override)); + return (item && (!(item->flag.trade_restriction&ITR_NOCART) || gmlv >= item->gm_lv_trade_override)); } int itemdb_canstore_sub(struct item_data* item, int gmlv, int unused) { - return (item && (!(item->flag.trade_restriction&32) || gmlv >= item->gm_lv_trade_override)); + return (item && (!(item->flag.trade_restriction&ITR_NOSTORAGE) || gmlv >= item->gm_lv_trade_override)); } int itemdb_canguildstore_sub(struct item_data* item, int gmlv, int unused) { - return (item && (!(item->flag.trade_restriction&64) || gmlv >= item->gm_lv_trade_override)); + return (item && (!(item->flag.trade_restriction&ITR_NOGSTORAGE) || gmlv >= item->gm_lv_trade_override)); } int itemdb_canmail_sub(struct item_data* item, int gmlv, int unused) { - return (item && (!(item->flag.trade_restriction&128) || gmlv >= item->gm_lv_trade_override)); + return (item && (!(item->flag.trade_restriction&ITR_NOMAIL) || gmlv >= item->gm_lv_trade_override)); } int itemdb_canauction_sub(struct item_data* item, int gmlv, int unused) { - return (item && (!(item->flag.trade_restriction&256) || gmlv >= item->gm_lv_trade_override)); + return (item && (!(item->flag.trade_restriction&ITR_NOAUCTION) || gmlv >= item->gm_lv_trade_override)); } int itemdb_isrestricted(struct item* item, int gmlv, int gmlv2, int (*func)(struct item_data*, int, int)) @@ -1240,7 +1240,7 @@ bool itemdb_read_itemtrade(char* str[], int columns, int current) flag = atoi(str[1]); gmlv = atoi(str[2]); - if( flag < 0 || flag > 511 ) {//Check range + if( flag < 0 || flag > ITR_ALL ) {//Check range ShowWarning("itemdb_read_itemtrade: Invalid trading mask %d for item id %d.\n", flag, nameid); return false; } |