From 4f23ac6a3862cbf1b1cbd8bea240c9fdf9290937 Mon Sep 17 00:00:00 2001 From: skotlex Date: Sat, 8 Apr 2006 06:08:29 +0000 Subject: - Modified the equip_job field in the item_db to be a hexadecimal value for easier handling. - Updated item_db.sql to this new file format (even though it's equip_jobs field is still a integer) - Added upgrade_svn5951.sql for those who would like to convert their existing items. - Added doc/item_db.txt to explain each of the fields in db/item_db.txt git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5951 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/itemdb.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/map/itemdb.c b/src/map/itemdb.c index d9f75a6e7..9b48efec9 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -194,12 +194,17 @@ struct item_data* itemdb_exists(int nameid) * to the format used by the map server. [Skotlex] *------------------------------------------ */ -static void itemdb_jobid2mapid(unsigned int *bclass, int jobmask) +static void itemdb_jobid2mapid(unsigned int *bclass, unsigned int jobmask) { int i; bclass[0]= bclass[1]= bclass[2]= 0; //Base classes - for (i = JOB_NOVICE; i <= JOB_THIEF; i++) + if (jobmask & 1<jname, id->slot, MAX_SLOTS); id->slot = MAX_SLOTS; } - itemdb_jobid2mapid(id->class_base, (sql_row[11] != NULL) ? atoi(sql_row[11]) : 0); + itemdb_jobid2mapid(id->class_base, (sql_row[11] != NULL) ? (unsigned int)strtol(sql_row[11], NULL, 0) : 0); id->class_upper= (sql_row[12] != NULL) ? atoi(sql_row[12]) : 0; id->sex = (sql_row[13] != NULL) ? atoi(sql_row[13]) : 0; id->equip = (sql_row[14] != NULL) ? atoi(sql_row[14]) : 0; @@ -1054,7 +1057,7 @@ static int itemdb_readdb(void) ShowWarning("itemdb_readdb: Item %d (%s) specifies %d slots, but the server only supports up to %d\n", nameid, id->jname, id->slot, MAX_SLOTS); id->slot = MAX_SLOTS; } - itemdb_jobid2mapid(id->class_base, atoi(str[11])); + itemdb_jobid2mapid(id->class_base, (unsigned int)strtol(str[11],NULL,0)); id->class_upper = atoi(str[12]); id->sex = atoi(str[13]); if(id->equip != atoi(str[14])){ -- cgit v1.2.3-70-g09d2