diff options
author | Haru <haru@dotalux.com> | 2019-10-20 17:43:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-20 17:43:44 +0200 |
commit | 275edef51c858e9e55934ec3af92ec19db74f3d3 (patch) | |
tree | 81c4367dfb4d51fec9c71c2a407f502a514b6a67 /src/char/char.c | |
parent | ddd0e461fb8e451912a6aee90869023e2c2d8272 (diff) | |
parent | be955e59bcd950d6430189a8a23a608927665c02 (diff) | |
download | hercules-275edef51c858e9e55934ec3af92ec19db74f3d3.tar.gz hercules-275edef51c858e9e55934ec3af92ec19db74f3d3.tar.bz2 hercules-275edef51c858e9e55934ec3af92ec19db74f3d3.tar.xz hercules-275edef51c858e9e55934ec3af92ec19db74f3d3.zip |
Merge pull request #2547 from guilherme-gm/201910-dehardcode-db
Dehardcode DB files path
Diffstat (limited to 'src/char/char.c')
-rw-r--r-- | src/char/char.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/char/char.c b/src/char/char.c index 37db77300..66bfdd4ee 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -120,8 +120,6 @@ char char_achievement_db[256] = "char_achievements"; static struct char_interface char_s; struct char_interface *chr; -char db_path[1024] = "db"; - static char wisp_server_name[NAME_LENGTH] = "Server"; static char login_ip_str[128]; static uint32 login_ip = 0; @@ -5792,7 +5790,8 @@ static bool char_config_read_database(const char *filename, const struct config_ if (autosave_interval <= 0) autosave_interval = DEFAULT_AUTOSAVE_INTERVAL; } - libconfig->setting_lookup_mutable_string(setting, "db_path", db_path, sizeof(db_path)); + libconfig->setting_lookup_mutable_string(setting, "db_path", chr->db_path, sizeof(chr->db_path)); + libconfig->set_db_path(chr->db_path); libconfig->setting_lookup_bool_real(setting, "log_char", &chr->enable_logs); return true; } @@ -6454,6 +6453,8 @@ void char_defaults(void) chr = &char_s; memset(chr->server, 0, sizeof(chr->server)); + sprintf(chr->db_path, "db"); + libconfig->set_db_path(chr->db_path); chr->login_fd = 0; chr->char_fd = -1; |