diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-08-30 13:56:27 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-08-30 13:56:27 +0000 |
commit | c8db14a97b3d3ba0d8a255e57d941968e265ef1c (patch) | |
tree | 969ebd73f2b0f1da94f4ee7bd7aa316ef63b8b2b /src/char_sql/itemdb.c | |
parent | 9f0ff780a9b3de47895dfeb20417390d2bd9dc93 (diff) | |
download | hercules-c8db14a97b3d3ba0d8a255e57d941968e265ef1c.tar.gz hercules-c8db14a97b3d3ba0d8a255e57d941968e265ef1c.tar.bz2 hercules-c8db14a97b3d3ba0d8a255e57d941968e265ef1c.tar.xz hercules-c8db14a97b3d3ba0d8a255e57d941968e265ef1c.zip |
- Fixed char-sql compilation
- Added support for reading the item_db_db inter config settings (char-sql)
- Fixed some compile warnings (functions with no arguments should have a (void) instead of ()).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8546 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char_sql/itemdb.c')
-rw-r--r-- | src/char_sql/itemdb.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/src/char_sql/itemdb.c b/src/char_sql/itemdb.c index f2f38efb5..a8148f866 100644 --- a/src/char_sql/itemdb.c +++ b/src/char_sql/itemdb.c @@ -19,6 +19,7 @@ //#define ITEMDB_OVERRIDE_NAME_VERBOSE 1
char item_db_db[256]="item_db"; // added to specify item_db sql table [Valaris]
+char item_db2_db[256]="item_db2";
static struct dbt* item_db;
@@ -168,8 +169,8 @@ static int itemdb_read_sqldb(void) // sql item_db read, shortened version of map sprintf(tmp_sql, "SELECT * FROM `%s`", item_db_name[i]);
// Execute the query; if the query execution succeeded...
- if (mysql_query(&mmysql_handle, tmp_sql) == 0) {
- sql_res = mysql_store_result(&mmysql_handle);
+ if (mysql_query(&mysql_handle, tmp_sql) == 0) {
+ sql_res = mysql_store_result(&mysql_handle);
// If the storage of the query result succeeded...
if (sql_res) {
@@ -203,14 +204,14 @@ static int itemdb_read_sqldb(void) // sql item_db read, shortened version of map ShowStatus("Done reading '"CL_WHITE"%lu"CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"'.\n", ln, item_db_name[i]);
ln = 0;
} else {
- ShowSQL("DB error (%s) - %s\n",item_db_name[i], mysql_error(&mmysql_handle));
+ ShowSQL("DB error (%s) - %s\n",item_db_name[i], mysql_error(&mysql_handle));
ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
}
// Free the query result
mysql_free_result(sql_res);
} else {
- ShowSQL("DB error (%s) - %s\n",item_db_name[i], mysql_error(&mmysql_handle));
+ ShowSQL("DB error (%s) - %s\n",item_db_name[i], mysql_error(&mysql_handle));
ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
}
}
@@ -218,17 +219,6 @@ static int itemdb_read_sqldb(void) // sql item_db read, shortened version of map return 0;
}
-static int itemdb_final(DBKey key,void *data,va_list ap)
-{
- struct item_data *id = (struct item_data*)data;
- if(id->use_script)
- aFree(id->use_script);
- if(id->equip_script)
- aFree(id->equip_script);
- return 0;
-}
-
-
/*==========================================
*
*------------------------------------------
@@ -236,7 +226,7 @@ static int itemdb_final(DBKey key,void *data,va_list ap) void do_final_itemdb(void)
{
if(item_db){
- item_db->destroy(item_db,itemdb_final);
+ item_db->destroy(item_db,NULL);
item_db=NULL;
}
}
|