From f606519c3b611573ade246ec82db26437bf03668 Mon Sep 17 00:00:00 2001 From: Dastgir Date: Mon, 4 Jan 2016 18:39:55 +0530 Subject: Changing Job field to 'int64' Signed-off-by: Haru --- src/map/itemdb.c | 16 ++++++++-------- src/map/itemdb.h | 6 +++--- src/map/pc.c | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/map/itemdb.c b/src/map/itemdb.c index f1c1e5b38..daae2a943 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -352,14 +352,14 @@ const char* itemdb_typename(int type) * * @author Dastgir */ -void itemdb_jobid2mapid(unsigned int *bclass, int job_id, bool enable) +void itemdb_jobid2mapid(uint64 *bclass, int job_id, bool enable) { #define set_jobmask(bclass_idx, mapid) \ do { \ if (enable) \ - bclass[(bclass_idx)] |= 1<<(mapid); \ + bclass[(bclass_idx)] |= 1L<<(mapid); \ else \ - bclass[(bclass_idx)] &= ~(1<<(mapid)); \ + bclass[(bclass_idx)] &= ~(1L<<(mapid)); \ } while (false) nullpo_retv(bclass); @@ -463,11 +463,11 @@ void itemdb_jobid2mapid(unsigned int *bclass, int job_id, bool enable) * @param bclass Pointer to the variable containing the new format. * @param jobmask Variable containing JobMask. */ -void itemdb_jobmask2mapid(unsigned int *bclass, unsigned int jobmask) +void itemdb_jobmask2mapid(uint64 *bclass, int64 jobmask) { int i; nullpo_retv(bclass); - bclass[0]= bclass[1]= bclass[2]= 0; + bclass[0] = bclass[1] = bclass[2] = 0; //Base classes if (jobmask & 1<jobmask2mapid(id->class_base, UINT_MAX); + itemdb->jobmask2mapid(id->class_base, UINT64_MAX); } else if ((job_id = pc->check_job_name(job_name)) == -1) { ShowWarning("itemdb_readdb_job_sub: unknown job name '%s'!\n", job_name); } else { @@ -1822,10 +1822,10 @@ int itemdb_readdb_libconfig_sub(struct config_setting_t *it, int n, const char * if (config_setting_is_group(t)) { itemdb->readdb_job_sub(&id, t); } else if (itemdb->lookup_const(it, "Job", &i32) && i32 >= 0) { - itemdb->jobmask2mapid(id.class_base, (unsigned int)i32); + itemdb->jobmask2mapid(id.class_base, i32); } } else if (!inherit) { - itemdb->jobmask2mapid(id.class_base, UINT_MAX); + itemdb->jobmask2mapid(id.class_base, UINT64_MAX); } if( itemdb->lookup_const(it, "Upper", &i32) && i32 >= 0 ) diff --git a/src/map/itemdb.h b/src/map/itemdb.h index 30a816521..3834b1954 100644 --- a/src/map/itemdb.h +++ b/src/map/itemdb.h @@ -478,7 +478,7 @@ struct item_data { int delay; //Lupus: I rearranged order of these fields due to compatibility with ITEMINFO script command // some script commands should be revised as well... - unsigned int class_base[3]; ///< Specifies if the base can wear this item (split in 3 indexes per type: 1-1, 2-1, 2-2) + uint64 class_base[3]; ///< Specifies if the base can wear this item (split in 3 indexes per type: 1-1, 2-1, 2-2) unsigned class_upper : 6; ///< Specifies if the upper-type can equip it (bitfield, 0x01: normal, 0x02: upper, 0x04: baby normal, 0x08: third normal, 0x10: third upper, 0x20: third baby) struct { unsigned short chance; @@ -608,8 +608,8 @@ struct itemdb_interface { int (*searchname_array_sub) (DBKey key, DBData data, va_list ap); int (*searchrandomid) (struct item_group *group); const char* (*typename) (int type); - void (*jobmask2mapid) (unsigned int *bclass, unsigned int jobmask); - void (*jobid2mapid) (unsigned int *bclass, int job_id, bool enable); + void (*jobmask2mapid) (uint64 *bclass, int64 jobmask); + void (*jobid2mapid) (uint64 *bclass, int job_id, bool enable); void (*create_dummy_data) (void); struct item_data* (*create_item_data) (int nameid); int (*isequip) (int nameid); diff --git a/src/map/pc.c b/src/map/pc.c index 919205b81..ac34910a2 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -998,7 +998,7 @@ int pc_isequip(struct map_session_data *sd,int n) } } //Not equipable by class. [Skotlex] - if (!(1<<(sd->class_&MAPID_BASEMASK)&item->class_base[(sd->class_&JOBL_2_1)?1:((sd->class_&JOBL_2_2)?2:0)])) + if (!(1L<<(sd->class_&MAPID_BASEMASK)&item->class_base[(sd->class_&JOBL_2_1)?1:((sd->class_&JOBL_2_2)?2:0)])) return 0; //Not usable by upper class. [Inkfish] while( 1 ) { @@ -4842,7 +4842,7 @@ int pc_isUseitem(struct map_session_data *sd,int n) //Not equipable by class. [Skotlex] if (!( - (1<<(sd->class_&MAPID_BASEMASK)) & + (1L<<(sd->class_&MAPID_BASEMASK)) & (item->class_base[(sd->class_&JOBL_2_1) ? 1 : ((sd->class_&JOBL_2_2) ? 2 : 0)]) )) return 0; -- cgit v1.2.3-60-g2f50