summaryrefslogtreecommitdiff
path: root/src/map/itemdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/itemdb.c')
-rw-r--r--src/map/itemdb.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index 3bb77ed34..7f9fedb6b 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -394,41 +394,42 @@ int itemdb_isstackable2(struct item_data *data)
/*==========================================
* Trade Restriction functions [Skotlex]
*------------------------------------------*/
-int itemdb_isdropable_sub(struct item_data *item, int gmlv, int unused)
-{
+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));
}
-int itemdb_cantrade_sub(struct item_data* item, int gmlv, int gmlv2)
-{
+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));
}
-int itemdb_canpartnertrade_sub(struct item_data* item, int gmlv, int gmlv2)
-{
+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));
}
-int itemdb_cansell_sub(struct item_data* item, int gmlv, int unused)
-{
+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));
}
-int itemdb_cancartstore_sub(struct item_data* item, int gmlv, int unused)
-{
+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));
}
-int itemdb_canstore_sub(struct item_data* item, int gmlv, int unused)
-{
+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));
}
-int itemdb_canguildstore_sub(struct item_data* item, int gmlv, int unused)
-{
+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));
}
+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));
+}
+
+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));
+}
+
int itemdb_isrestricted(struct item* item, int gmlv, int gmlv2, int (*func)(struct item_data*, int, int))
{
struct item_data* item_data = itemdb_search(item->nameid);
@@ -615,7 +616,7 @@ static bool itemdb_read_itemtrade(char* str[], int columns, int current)
flag = atoi(str[1]);
gmlv = atoi(str[2]);
- if( flag < 0 || flag >= 128 )
+ if( flag < 0 || flag > 256 )
{//Check range
ShowWarning("itemdb_read_itemtrade: Invalid trading mask %d for item id %d.\n", flag, nameid);
return false;