summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDastgir <dastgirpojee@rocketmail.com>2016-01-04 18:39:55 +0530
committerHaru <haru@dotalux.com>2016-02-21 21:02:59 +0100
commitf606519c3b611573ade246ec82db26437bf03668 (patch)
treeb8afd833b1ba602f0539dfa7c805c3613692a37a
parent2d4c6eb05e19c31e7b4f69496ce55b6e611a7d35 (diff)
downloadhercules-f606519c3b611573ade246ec82db26437bf03668.tar.gz
hercules-f606519c3b611573ade246ec82db26437bf03668.tar.bz2
hercules-f606519c3b611573ade246ec82db26437bf03668.tar.xz
hercules-f606519c3b611573ade246ec82db26437bf03668.zip
Changing Job field to 'int64'
Signed-off-by: Haru <haru@dotalux.com>
-rw-r--r--src/map/itemdb.c16
-rw-r--r--src/map/itemdb.h6
-rw-r--r--src/map/pc.c4
3 files changed, 13 insertions, 13 deletions
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<<JOB_NOVICE) {
//Both Novice/Super-Novice are counted with the same ID
@@ -1668,7 +1668,7 @@ void itemdb_readdb_job_sub(struct item_data *id, struct config_setting_t *t)
int job_id;
if (strcmp(job_name, "All") == 0) {
- itemdb->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;