From 5b673efa121320d1575e126243fa2c7ec460952d Mon Sep 17 00:00:00 2001 From: Haru Date: Tue, 16 Feb 2016 13:31:41 +0100 Subject: Renamed config->read_file to config->load_file - The return value is now consistent with the libconfig standard (CONFIG_TRUE/CONFIG_FALSE). - Removed some redundant error messages. Signed-off-by: Haru --- src/map/script.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/map/script.c') diff --git a/src/map/script.c b/src/map/script.c index f3c839555..eb8879a2a 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -2297,7 +2297,10 @@ void read_constdb(void) sprintf(filepath, "%s/constants.conf", map->db_path); - if (libconfig->read_file(&constants_conf, filepath) || !(cdb = libconfig->setting_get_member(constants_conf.root, "constants_db"))) { + if (!libconfig->load_file(&constants_conf, filepath)) + return; + + if ((cdb = libconfig->setting_get_member(constants_conf.root, "constants_db")) == NULL) { ShowError("can't read %s\n", filepath); return; } @@ -4822,12 +4825,10 @@ void script_load_translations(void) { script->add_language("English");/* 0 is default, which is whatever is in the npc files hardcoded (in our case, English) */ - if (libconfig->read_file(&translations_conf, config_filename)) { - ShowError("load_translations: can't read '%s'\n", config_filename); + if (!libconfig->load_file(&translations_conf, config_filename)) return; - } - if( !(translations = libconfig->lookup(&translations_conf, "translations")) ) { + if ((translations = libconfig->lookup(&translations_conf, "translations")) == NULL) { ShowError("load_translations: invalid format on '%s'\n",config_filename); return; } -- cgit v1.2.3-70-g09d2