summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorSusu <bruant.bastien@gmail.com>2013-07-29 16:07:06 +0200
committerSusu <bruant.bastien@gmail.com>2013-07-29 16:07:06 +0200
commit328525e468c35e8b266b160adbf09792faa64669 (patch)
treee0e393585bc5b831a0a53ec1c8d89d7401f2ce65 /src/map/pc.c
parentb7171479a47490ff80bf04849f763158d6d96fac (diff)
parent15a3f6a5270943af44eb82fa01203464ce396aec (diff)
downloadhercules-328525e468c35e8b266b160adbf09792faa64669.tar.gz
hercules-328525e468c35e8b266b160adbf09792faa64669.tar.bz2
hercules-328525e468c35e8b266b160adbf09792faa64669.tar.xz
hercules-328525e468c35e8b266b160adbf09792faa64669.zip
Merge branch 'master' of https://github.com/HerculesWS/Hercules
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index e0f2bf2f8..0a815cb24 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -4249,12 +4249,26 @@ int pc_isUseitem(struct map_session_data *sd,int n)
(item->class_base[sd->class_&JOBL_2_1?1:(sd->class_&JOBL_2_2?2:0)])
))
return 0;
- //Not usable by upper class. [Inkfish]
+
+ //Not usable by upper class. [Haru]
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;
+ // Normal classes (no upper, no baby, no third classes)
+ if( item->class_upper&0x01 && !(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;
+#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;
+#endif
+ // Baby classes (no third classes)
+ if( item->class_upper&0x04 && 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;
+ // Upper third classes
+ if( item->class_upper&0x10 && 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;
return 0;
}