summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2013-11-08 07:18:40 +0100
committerHaru <haru@dotalux.com>2013-11-14 20:15:28 +0100
commited72a947a6c97804c1eef5b80bfa49d99f7d7586 (patch)
treef9196c943010e26c13c12d38c7a622d43301a4cd /src/map/pc.c
parent7d0a63b72f93c05b302c08cfb19d5651cef1cdb8 (diff)
downloadhercules-ed72a947a6c97804c1eef5b80bfa49d99f7d7586.tar.gz
hercules-ed72a947a6c97804c1eef5b80bfa49d99f7d7586.tar.bz2
hercules-ed72a947a6c97804c1eef5b80bfa49d99f7d7586.tar.xz
hercules-ed72a947a6c97804c1eef5b80bfa49d99f7d7586.zip
Item DB overhaul
http://hercules.ws/board/topic/2954-item-db-file-structure-overhaul - Item db was changed to libconfig format. - This new format is larger than the original format, but it's less subject to conflicts when some items are edited and the file gets updated. - It is no longer necessary to specify fields with no value, and only the actually used fields are specified. - Items scripts (especially the long ones) are made more readable by splitting them into multiple lines, with proper indentation. - A converter perl script is provided in the tools directory (and a link to the web-based version of the same script canbe found in the above forum topic) - All of this was made possible thanks to Ind, Yommy. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 7a04f1fb8..d597ccf9f 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -983,10 +983,10 @@ int pc_isequip(struct map_session_data *sd,int n)
return 0;
//Not usable by upper class. [Inkfish]
while( 1 ) {
- if( item->class_upper&1 && !(sd->class_&(JOBL_UPPER|JOBL_THIRD|JOBL_BABY)) ) break;
- if( item->class_upper&2 && sd->class_&(JOBL_UPPER|JOBL_THIRD) ) break;
- if( item->class_upper&4 && sd->class_&JOBL_BABY ) break;
- if( item->class_upper&8 && sd->class_&JOBL_THIRD ) break;
+ if( item->class_upper&ITEMUPPER_NORMAL && !(sd->class_&(JOBL_UPPER|JOBL_THIRD|JOBL_BABY)) ) break;
+ if( item->class_upper&ITEMUPPER_UPPER && sd->class_&(JOBL_UPPER|JOBL_THIRD) ) break;
+ if( item->class_upper&ITEMUPPER_BABY && sd->class_&JOBL_BABY ) break;
+ if( item->class_upper&ITEMUPPER_THIRD && sd->class_&JOBL_THIRD ) break;
return 0;
}
@@ -4338,22 +4338,22 @@ int pc_isUseitem(struct map_session_data *sd,int n)
//Not usable by upper class. [Haru]
while( 1 ) {
// Normal classes (no upper, no baby, no third classes)
- if( item->class_upper&0x01 && !(sd->class_&(JOBL_UPPER|JOBL_THIRD|JOBL_BABY)) ) break;
+ if( item->class_upper&ITEMUPPER_NORMAL && !(sd->class_&(JOBL_UPPER|JOBL_THIRD|JOBL_BABY)) ) break;
#ifdef RENEWAL
// Upper classes (no third classes)
- if( item->class_upper&0x02 && sd->class_&JOBL_UPPER && !(sd->class_&JOBL_THIRD) ) break;
+ if( item->class_upper&ITEMUPPER_UPPER && sd->class_&JOBL_UPPER && !(sd->class_&JOBL_THIRD) ) break;
#else
//pre-re has no use for the extra, so we maintain the previous for backwards compatibility
- if( item->class_upper&0x02 && sd->class_&(JOBL_UPPER|JOBL_THIRD) ) break;
+ if( item->class_upper&ITEMUPPER_UPPER && sd->class_&(JOBL_UPPER|JOBL_THIRD) ) break;
#endif
// Baby classes (no third classes)
- if( item->class_upper&0x04 && sd->class_&JOBL_BABY && !(sd->class_&JOBL_THIRD) ) break;
+ if( item->class_upper&ITEMUPPER_BABY && sd->class_&JOBL_BABY && !(sd->class_&JOBL_THIRD) ) break;
// Third classes (no upper, no baby classes)
- if( item->class_upper&0x08 && sd->class_&JOBL_THIRD && !(sd->class_&(JOBL_UPPER|JOBL_BABY)) ) break;
+ if( item->class_upper&ITEMUPPER_THIRD && sd->class_&JOBL_THIRD && !(sd->class_&(JOBL_UPPER|JOBL_BABY)) ) break;
// Upper third classes
- if( item->class_upper&0x10 && sd->class_&JOBL_THIRD && sd->class_&JOBL_UPPER ) break;
+ if( item->class_upper&ITEMUPPER_THURDUPPER && sd->class_&JOBL_THIRD && sd->class_&JOBL_UPPER ) break;
// Baby third classes
- if( item->class_upper&0x20 && sd->class_&JOBL_THIRD && sd->class_&JOBL_BABY ) break;
+ if( item->class_upper&ITEMUPPER_THIRDBABY && sd->class_&JOBL_THIRD && sd->class_&JOBL_BABY ) break;
return 0;
}