diff --git a/src/map/itemdb.c b/src/map/itemdb.c index 232d3c0629..e0e27a1fc5 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -281,79 +281,84 @@ const char* itemdb_typename(enum item_types type) return "Unknown Type"; } -/*========================================== - * Converts the jobid from the format in itemdb - * to the format used by the map server. [Skotlex] - *------------------------------------------*/ -static void itemdb_jobid2mapid(unsigned int *bclass, unsigned int jobmask) +/** + * Converts the jobmask from the format in itemdb to the format used by the map server. + * @param bclass: Pointer to store itemdb format + * @param jobmask: Job Mask to convert + * @author: Skotlex + */ +static void itemdb_jobid2mapid(uint64 *bclass, uint64 jobmask) { int i; - bclass[0]= bclass[1]= bclass[2]= 0; + + bclass[0] = bclass[1] = bclass[2] = 0; + //Base classes - if (jobmask & 1<class_&MAPID_BASEMASK)&item->class_base[(sd->class_&JOBL_2_1)?1:((sd->class_&JOBL_2_2)?2:0)])) + if (!(1ULL<<(sd->class_&MAPID_BASEMASK)&item->class_base[(sd->class_&JOBL_2_1)?1:((sd->class_&JOBL_2_2)?2:0)])) return ITEM_EQUIP_ACK_FAIL; if (!pc_isItemClass(sd,item)) @@ -4783,7 +4783,7 @@ bool pc_isUseitem(struct map_session_data *sd,int n) //Not equipable by class. [Skotlex] if (!( - (1<<(sd->class_&MAPID_BASEMASK)) & + (1ULL<<(sd->class_&MAPID_BASEMASK)) & (item->class_base[sd->class_&JOBL_2_1?1:(sd->class_&JOBL_2_2?2:0)]) )) return false;