diff options
Diffstat (limited to 'src/map/itemdb.c')
-rw-r--r-- | src/map/itemdb.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/map/itemdb.c b/src/map/itemdb.c index 2a5fa48de..e0cb642fb 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -30,7 +30,7 @@ struct item_data dummy_item; //This is the default dummy item used for non-exist */ static int itemdb_searchname_sub(DBKey key, DBData *data, va_list ap) { - struct item_data *item = DB->data2ptr(data), **dst, **dst2; + struct item_data *item = iDB->data2ptr(data), **dst, **dst2; char *str; str=va_arg(ap,char *); dst=va_arg(ap,struct item_data **); @@ -83,7 +83,7 @@ struct item_data* itemdb_searchname(const char *str) */ static int itemdb_searchname_array_sub(DBKey key, DBData data, va_list ap) { - struct item_data *item = DB->data2ptr(&data); + struct item_data *item = iDB->data2ptr(&data); char *str; str=va_arg(ap,char *); if (item == &dummy_item) @@ -127,7 +127,7 @@ int itemdb_searchname_array(struct item_data** data, int size, const char *str) size -= count; db_count = itemdb_other->getall(itemdb_other, (DBData**)&db_data, size, itemdb_searchname_array_sub, str); for (i = 0; i < db_count; i++) - data[count++] = DB->data2ptr(db_data[i]); + data[count++] = iDB->data2ptr(db_data[i]); count += db_count; } return count; @@ -590,7 +590,7 @@ static void itemdb_read_itemgroup(void) { char path[256]; unsigned int count; - snprintf(path, 255, "%s/"DBPATH"item_group_db.txt", db_path); + snprintf(path, 255, "%s/"DBPATH"item_group_db.txt", iMap->db_path); memset(&itemgroup_db, 0, sizeof(itemgroup_db)); count = itemdb_read_itemgroup_sub(path); ShowStatus("Done reading '"CL_WHITE"%lu"CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"'.\n", count, "item_group_db.txt"); @@ -785,7 +785,7 @@ void itemdb_read_combos() { char path[256]; FILE* fp; - sprintf(path, "%s/%s", db_path, DBPATH"item_combo_db.txt"); + sprintf(path, "%s/%s", iMap->db_path, DBPATH"item_combo_db.txt"); if ((fp = fopen(path, "r")) == NULL) { ShowError("itemdb_read_combos: File not found \"%s\".\n", path); @@ -1110,7 +1110,7 @@ static int itemdb_readdb(void) char path[256]; FILE* fp; - sprintf(path, "%s/%s", db_path, filename[fi]); + sprintf(path, "%s/%s", iMap->db_path, filename[fi]); fp = fopen(path, "r"); if( fp == NULL ) { ShowWarning("itemdb_readdb: File not found \"%s\", skipping.\n", path); @@ -1226,11 +1226,11 @@ static int itemdb_read_sqldb(void) { const char* item_db_name[] = { #ifdef RENEWAL - item_db_re_db, + iMap->item_db_re_db, #else - item_db_db, + iMap->item_db_db, #endif - item_db2_db }; + iMap->item_db2_db }; int fi; for( fi = 0; fi < ARRAYLENGTH(item_db_name); ++fi ) { @@ -1318,19 +1318,19 @@ int itemdb_uid_load(){ *------------------------------------*/ static void itemdb_read(void) { - if (db_use_sqldbs) + if (iMap->db_use_sqldbs) itemdb_read_sqldb(); else itemdb_readdb(); itemdb_read_combos(); itemdb_read_itemgroup(); - sv->readdb(db_path, "item_avail.txt", ',', 2, 2, -1, &itemdb_read_itemavail); - sv->readdb(db_path, DBPATH"item_trade.txt", ',', 3, 3, -1, &itemdb_read_itemtrade); - sv->readdb(db_path, "item_delay.txt", ',', 2, 2, -1, &itemdb_read_itemdelay); - sv->readdb(db_path, "item_stack.txt", ',', 3, 3, -1, &itemdb_read_stack); - sv->readdb(db_path, DBPATH"item_buyingstore.txt", ',', 1, 1, -1, &itemdb_read_buyingstore); - sv->readdb(db_path, "item_nouse.txt", ',', 3, 3, -1, &itemdb_read_nouse); + sv->readdb(iMap->db_path, "item_avail.txt", ',', 2, 2, -1, &itemdb_read_itemavail); + sv->readdb(iMap->db_path, DBPATH"item_trade.txt", ',', 3, 3, -1, &itemdb_read_itemtrade); + sv->readdb(iMap->db_path, "item_delay.txt", ',', 2, 2, -1, &itemdb_read_itemdelay); + sv->readdb(iMap->db_path, "item_stack.txt", ',', 3, 3, -1, &itemdb_read_stack); + sv->readdb(iMap->db_path, DBPATH"item_buyingstore.txt", ',', 1, 1, -1, &itemdb_read_buyingstore); + sv->readdb(iMap->db_path, "item_nouse.txt", ',', 3, 3, -1, &itemdb_read_nouse); itemdb_uid_load(); } @@ -1376,7 +1376,7 @@ static void destroy_item_data(struct item_data* self, int free_self) */ static int itemdb_final_sub(DBKey key, DBData *data, va_list ap) { - struct item_data *id = DB->data2ptr(data); + struct item_data *id = iDB->data2ptr(data); if( id != &dummy_item ) destroy_item_data(id, 1); @@ -1435,7 +1435,7 @@ void itemdb_reload(void) iter = mapit_geteachpc(); for( sd = (struct map_session_data*)mapit->first(iter); mapit->exists(iter); sd = (struct map_session_data*)mapit->next(iter) ) { memset(sd->item_delay, 0, sizeof(sd->item_delay)); // reset item delays - pc_setinventorydata(sd); + iPc->setinventorydata(sd); /* clear combo bonuses */ if( sd->combos.count ) { aFree(sd->combos.bonus); @@ -1443,7 +1443,7 @@ void itemdb_reload(void) sd->combos.bonus = NULL; sd->combos.id = NULL; sd->combos.count = 0; - if( pc_load_combo(sd) > 0 ) + if( iPc->load_combo(sd) > 0 ) status_calc_pc(sd,0); } |