summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2014-05-31 03:00:34 +0200
committerHaru <haru@dotalux.com>2014-05-31 03:00:34 +0200
commit5f0677d6557689e1d6dc9ab5da65a9e407e31b97 (patch)
treeecf4aa29ddc4115a063dea202b66c52c91d91892
parent3dccf7e300f9868a98075e1863c88c38d3211f33 (diff)
downloadhercules-5f0677d6557689e1d6dc9ab5da65a9e407e31b97.tar.gz
hercules-5f0677d6557689e1d6dc9ab5da65a9e407e31b97.tar.bz2
hercules-5f0677d6557689e1d6dc9ab5da65a9e407e31b97.tar.xz
hercules-5f0677d6557689e1d6dc9ab5da65a9e407e31b97.zip
Added ItemNouseRestriction enum
- To be used in a follow-up item_db.conf edit. Signed-off-by: Haru <haru@dotalux.com>
-rw-r--r--src/map/itemdb.h20
-rw-r--r--src/map/pc.c2
2 files changed, 14 insertions, 8 deletions
diff --git a/src/map/itemdb.h b/src/map/itemdb.h
index 5aabdc5c2..5c1628374 100644
--- a/src/map/itemdb.h
+++ b/src/map/itemdb.h
@@ -319,10 +319,6 @@ enum geneticist_item_list {
ITEMID_BLACK_THING_TO_THROW, // 13290
};
-enum item_nouse_list {
- NOUSE_SITTING = 0x01,
-};
-
//
enum e_chain_cache {
ECC_ORE,
@@ -359,6 +355,16 @@ enum ItemTradeRestrictions {
ITR_ALL = 0x1ff ///< Sum of all the above values
};
+/**
+ * Iten No-use restrictions
+ */
+enum ItemNouseRestrictions {
+ INR_NONE = 0x0, ///< No restrictions
+ INR_SITTING = 0x1, ///< Item can't be used while sitting
+
+ INR_ALL = 0x1 ///< Sum of all the above values
+};
+
struct item_data {
uint16 nameid;
char name[ITEM_NAME_LENGTH],jname[ITEM_NAME_LENGTH];
@@ -398,7 +404,7 @@ struct item_data {
unsigned available : 1;
unsigned no_refine : 1; // [celest]
unsigned delay_consume : 1; // Signifies items that are not consumed immediately upon double-click [Skotlex]
- unsigned trade_restriction : 9; ///< Item restrictions mask (@see enum ItemTradeRestrictions)
+ unsigned trade_restriction : 9; ///< Item trade restrictions mask (@see enum ItemTradeRestrictions)
unsigned autoequip: 1;
unsigned buyingstore : 1;
unsigned bindonequip : 1;
@@ -410,8 +416,8 @@ struct item_data {
unsigned int storage:1;
unsigned int guildstorage:1;
} stack;
- struct {// used by item_nouse.txt
- unsigned int flag;
+ struct {
+ unsigned int flag; ///< Item nouse restriction mask (@see enum ItemNouseRestrictions)
unsigned short override;
} item_usage;
short gm_lv_trade_override; //GM-level to override trade_restriction
diff --git a/src/map/pc.c b/src/map/pc.c
index ce2b8040e..3afb6c556 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -4191,7 +4191,7 @@ int pc_isUseitem(struct map_session_data *sd,int n)
if( !item->script ) //if it has no script, you can't really consume it!
return 0;
- if( (item->item_usage.flag&NOUSE_SITTING) && (pc_issit(sd) == 1) && (pc_get_group_level(sd) < item->item_usage.override) ) {
+ if( (item->item_usage.flag&INR_SITTING) && (pc_issit(sd) == 1) && (pc_get_group_level(sd) < item->item_usage.override) ) {
clif->msgtable(sd->fd,0x297);
//clif->colormes(sd->fd,COLOR_WHITE,msg_txt(1474));
return 0; // You cannot use this item while sitting.