diff options
author | Guilherme Menaldo <guilherme.menaldo@outlook.com> | 2019-10-01 22:57:09 -0300 |
---|---|---|
committer | Guilherme Menaldo <guilherme.menaldo@outlook.com> | 2019-10-05 16:42:54 -0300 |
commit | 7d25827001493a82a8f75cfc6a0b956164b44f05 (patch) | |
tree | 911eff2691b6804c6a971bd86234313ee1af7dcf /src/map/achievement.c | |
parent | d026e28fd78f60dfa21da381f17f2a8cc9ae3d11 (diff) | |
download | hercules-7d25827001493a82a8f75cfc6a0b956164b44f05.tar.gz hercules-7d25827001493a82a8f75cfc6a0b956164b44f05.tar.bz2 hercules-7d25827001493a82a8f75cfc6a0b956164b44f05.tar.xz hercules-7d25827001493a82a8f75cfc6a0b956164b44f05.zip |
Dehardcodes db files base path so the db folder can be easily moved
Diffstat (limited to 'src/map/achievement.c')
-rw-r--r-- | src/map/achievement.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/map/achievement.c b/src/map/achievement.c index 7ab80e183..c2ebb5fdd 100644 --- a/src/map/achievement.c +++ b/src/map/achievement.c @@ -1099,7 +1099,8 @@ static bool achievement_get_rewards(struct map_session_data *sd, const struct ac */ static void achievement_readdb_ranks(void) { - const char *filename = "db/achievement_rank_db.conf"; + char filename[256]; + libconfig->format_db_path("achievement_rank_db.conf", filename, sizeof(filename)); struct config_t ar_conf = { 0 }; struct config_setting_t *ardb = NULL, *conf = NULL; int entry = 0; @@ -1777,7 +1778,8 @@ static void achievement_readdb_additional_fields(const struct config_setting_t * */ static void achievement_readb(void) { - const char *filename = "db/"DBPATH"achievement_db.conf"; + char filename[256]; + libconfig->format_db_path(DBPATH"achievement_db.conf", filename, sizeof(filename)); struct config_t ach_conf = { 0 }; struct config_setting_t *achdb = NULL, *conf = NULL; int entry = 0, count = 0; |