diff options
Diffstat (limited to 'src/map/pc.c')
-rw-r--r-- | src/map/pc.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/map/pc.c b/src/map/pc.c index 11e775dea..1af83acc5 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; } |