diff options
author | shennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-09-07 04:02:51 +0000 |
---|---|---|
committer | shennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-09-07 04:02:51 +0000 |
commit | 07da7ceca8889d99c481057f612ec86c0883e2ff (patch) | |
tree | fedd8293963c8ccc58ef425f6e8025fc59ea14a0 | |
parent | 856265e88641238b78d359bd64912ad85864db79 (diff) | |
download | hercules-07da7ceca8889d99c481057f612ec86c0883e2ff.tar.gz hercules-07da7ceca8889d99c481057f612ec86c0883e2ff.tar.bz2 hercules-07da7ceca8889d99c481057f612ec86c0883e2ff.tar.xz hercules-07da7ceca8889d99c481057f612ec86c0883e2ff.zip |
Removed pre-re item_db from mysql item db load order when renewal is enabled (special thanks to Xantara for finding out).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16755 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r-- | src/map/itemdb.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/src/map/itemdb.c b/src/map/itemdb.c index 3f9af41c0..db571ed97 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -1194,37 +1194,36 @@ static int itemdb_readdb(void) /*====================================== * item_db table reading *======================================*/ -static int itemdb_read_sqldb(void) -{ -#ifdef RENEWAL - const char* item_db_name[] = { item_db_db, item_db_re_db, item_db2_db }; -#else - const char* item_db_name[] = { item_db_db, item_db2_db }; -#endif +static int itemdb_read_sqldb(void) { + + const char* item_db_name[] = { + #ifdef RENEWAL + item_db_re_db, + #else + item_db_db, + #endif + item_db2_db }; int fi; - for( fi = 0; fi < ARRAYLENGTH(item_db_name); ++fi ) - { + for( fi = 0; fi < ARRAYLENGTH(item_db_name); ++fi ) { uint32 lines = 0, count = 0; // retrieve all rows from the item database - if( SQL_ERROR == Sql_Query(mmysql_handle, "SELECT * FROM `%s`", item_db_name[fi]) ) - { + if( SQL_ERROR == Sql_Query(mmysql_handle, "SELECT * FROM `%s`", item_db_name[fi]) ) { Sql_ShowDebug(mmysql_handle); continue; } // process rows one by one - while( SQL_SUCCESS == Sql_NextRow(mmysql_handle) ) - {// wrap the result into a TXT-compatible format + while( SQL_SUCCESS == Sql_NextRow(mmysql_handle) ) {// wrap the result into a TXT-compatible format char* str[22]; char* dummy = ""; int i; ++lines; - for( i = 0; i < 22; ++i ) - { + for( i = 0; i < 22; ++i ) { Sql_GetData(mmysql_handle, i, &str[i], NULL); - if( str[i] == NULL ) str[i] = dummy; // get rid of NULL columns + if( str[i] == NULL ) + str[i] = dummy; // get rid of NULL columns } if (!itemdb_parse_dbrow(str, item_db_name[fi], lines, SCRIPT_IGNORE_EXTERNAL_BRACKETS)) |