diff options
Diffstat (limited to 'src/char_sql/itemdb.c')
-rw-r--r-- | src/char_sql/itemdb.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/char_sql/itemdb.c b/src/char_sql/itemdb.c index d045189a0..bc3e8603e 100644 --- a/src/char_sql/itemdb.c +++ b/src/char_sql/itemdb.c @@ -13,8 +13,6 @@ #include "memwatch.h" #endif -#define mysql_query(_x, _y) debug_mysql_query(__FILE__, __LINE__, _x, _y) - #define MAX_RANDITEM 2000 // ** ITEMDB_OVERRIDE_NAME_VERBOSE ** @@ -33,7 +31,7 @@ struct item_data* itemdb_search(int nameid) { struct item_data *id; - id=numdb_search(item_db,nameid); + id = (struct item_data*)numdb_search(item_db,nameid); if(id) return id; CREATE(id, struct item_data, 1); @@ -123,7 +121,7 @@ static int itemdb_readdb(void) } if(str[0]==NULL) continue; - + nameid=atoi(str[0]); if(nameid<=0 || nameid>=20000) continue; @@ -174,7 +172,7 @@ static int itemdb_read_sqldb(void) // sql item_db read, shortened version of map // Insert a new row into the item database /* - id = calloc(sizeof(struct item_data), 1); + id = aCalloc(sizeof(struct item_data), 1); if (id == NULL) { printf("out of memory : itemdb_read_sqldb\n"); @@ -187,7 +185,7 @@ static int itemdb_read_sqldb(void) // sql item_db read, shortened version of map // ---------- */ id=itemdb_search(nameid); - + memcpy(id->name, sql_row[1], 24); memcpy(id->jname, sql_row[2], 24); @@ -214,12 +212,12 @@ static int itemdb_final(void *key,void *data,va_list ap) { struct item_data *id; - id=data; + id = (struct item_data*)data; if(id->use_script) - free(id->use_script); + aFree(id->use_script); if(id->equip_script) - free(id->equip_script); - free(id); + aFree(id->equip_script); + aFree(id); return 0; } |