From 7d25827001493a82a8f75cfc6a0b956164b44f05 Mon Sep 17 00:00:00 2001 From: Guilherme Menaldo Date: Tue, 1 Oct 2019 22:57:09 -0300 Subject: Dehardcodes db files base path so the db folder can be easily moved --- src/map/clif.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/map/clif.c') diff --git a/src/map/clif.c b/src/map/clif.c index f6caa502e..f8e2b63a2 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -19784,7 +19784,8 @@ static void clif_cashshop_db(void) { struct config_t cashshop_conf; struct config_setting_t *cashshop = NULL, *cats = NULL; - const char *config_filename = "db/cashshop_db.conf"; // FIXME hardcoded name + char config_filename[256]; + libconfig->format_db_path("cashshop_db.conf", config_filename, sizeof(config_filename)); int i, item_count_t = 0; for( i = 0; i < CASHSHOP_TAB_MAX; i++ ) { CREATE(clif->cs.data[i], struct hCSData *, 1); @@ -21055,7 +21056,8 @@ static bool clif_parse_roulette_db(void) { struct config_t roulette_conf; struct config_setting_t *roulette = NULL, *levels = NULL; - const char *config_filename = "db/roulette_db.conf"; // FIXME hardcoded name + char config_filename[256]; + libconfig->format_db_path("roulette_db.conf", config_filename, sizeof(config_filename)); int i, j, item_count_t = 0; for( i = 0; i < MAX_ROULETTE_LEVEL; i++ ) { @@ -22539,7 +22541,8 @@ static bool clif_parse_attendance_db(void) { struct config_t attendance_conf; struct config_setting_t *attendance = NULL, *it = NULL; - const char *config_filename = "db/attendance_db.conf"; // FIXME hardcoded name + char config_filename[256]; + libconfig->format_db_path("attendance_db.conf", config_filename, sizeof(config_filename)); int i = 0; if (!libconfig->load_file(&attendance_conf, config_filename)) -- cgit v1.2.3-60-g2f50