summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c11
1 files changed, 6 insertions, 5 deletions
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;
}