diff options
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/battle.c | 4 | ||||
-rw-r--r-- | src/map/itemdb.c | 6 | ||||
-rw-r--r-- | src/map/map.c | 18 | ||||
-rw-r--r-- | src/map/map.h | 4 | ||||
-rw-r--r-- | src/map/mob.c | 2 |
5 files changed, 23 insertions, 11 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index b9669c319..18c95c76d 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -6554,8 +6554,8 @@ void Hercules_report(char* date, char *time_c) { #endif /* non-define part */ - if( iMap->db_use_sqldbs ) - config |= C_SQL_DBS; + if( iMap->db_use_sql_item_db || iMap->db_use_sql_mob_db || iMap->db_use_sql_mob_skill_db ) + config |= C_SQL_DBS; //TODO: split this config into three. if( logs->config.sql_logs ) config |= C_SQL_LOGS; diff --git a/src/map/itemdb.c b/src/map/itemdb.c index 4e0477b75..7b6fd0ed7 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -1346,7 +1346,7 @@ int itemdb_parse_dbrow(char** str, const char* source, int line, int scriptopt) id->weight = atoi(str[6]); #ifdef RENEWAL - if( iMap->db_use_sqldbs ) { + if( iMap->db_use_sql_item_db ) { id->atk = atoi(str[7]); id->matk = atoi(str[8]); offset += 1; @@ -1376,7 +1376,7 @@ int itemdb_parse_dbrow(char** str, const char* source, int line, int scriptopt) id->wlv = cap_value(atoi(str[15+offset]), REFINE_TYPE_ARMOR, REFINE_TYPE_MAX); #ifdef RENEWAL - if( iMap->db_use_sqldbs ) { + if( iMap->db_use_sql_item_db ) { id->elv = atoi(str[16+offset]); id->elvmax = atoi(str[17+offset]); offset += 1; @@ -1639,7 +1639,7 @@ int itemdb_uid_load() { * read all item-related databases *------------------------------------*/ static void itemdb_read(void) { - if (iMap->db_use_sqldbs) + if (iMap->db_use_sql_item_db) itemdb_read_sqldb(); else itemdb_readdb(); diff --git a/src/map/map.c b/src/map/map.c index 2770a8af7..3a2ca6c57 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -3548,9 +3548,17 @@ int inter_config_read(char *cfgName) { strcpy(map_server_db, w2); else if(strcmpi(w1,"default_codepage")==0) strcpy(default_codepage, w2); - else if(strcmpi(w1,"use_sql_db")==0) { - iMap->db_use_sqldbs = config_switch(w2); - ShowStatus ("Using SQL dbs: %s\n",w2); + else if(strcmpi(w1,"use_sql_item_db")==0) { + iMap->db_use_sql_item_db = config_switch(w2); + ShowStatus ("Using item database as SQL: '%s'\n", w2); + } + else if(strcmpi(w1,"use_sql_mob_db")==0) { + iMap->db_use_sql_mob_db = config_switch(w2); + ShowStatus ("Using monster database as SQL: '%s'\n", w2); + } + else if(strcmpi(w1,"use_sql_mob_skill_db")==0) { + iMap->db_use_sql_mob_skill_db = config_switch(w2); + ShowStatus ("Using monster skill database as SQL: '%s'\n", w2); } /* sql log db */ else if(strcmpi(w1,"log_db_ip")==0) @@ -5319,7 +5327,9 @@ int do_init(int argc, char *argv[]) iMap->night_flag = 0; // 0=day, 1=night [Yor] iMap->enable_spy = 0; //To enable/disable @spy commands, which consume too much cpu time when sending packets. [Skotlex] - iMap->db_use_sqldbs = 0; + iMap->db_use_sql_item_db = 0; + iMap->db_use_sql_mob_db = 0; + iMap->db_use_sql_mob_skill_db = 0; sprintf(iMap->item_db_db, "item_db"); sprintf(iMap->item_db2_db, "item_db2"); diff --git a/src/map/map.h b/src/map/map.h index 6002e56da..ec5921509 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -788,7 +788,9 @@ struct map_interface { char *MSG_CONF_NAME; char *GRF_PATH_FILENAME; - int db_use_sqldbs; + int db_use_sql_item_db; + int db_use_sql_mob_db; + int db_use_sql_mob_skill_db; char item_db_db[32]; char item_db2_db[32]; diff --git a/src/map/mob.c b/src/map/mob.c index 1e79d6b93..ad3dd50c3 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -4588,7 +4588,7 @@ static void mob_load(void) { sv->readdb(iMap->db_path, "mob_item_ratio.txt", ',', 2, 2+MAX_ITEMRATIO_MOBS, -1, &mob_readdb_itemratio); // must be read before mobdb mob_readchatdb(); - if (iMap->db_use_sqldbs) + if (iMap->db_use_sql_mob_db) { mob_read_sqldb(); mob_read_sqlskilldb(); |