summaryrefslogtreecommitdiff
path: root/src/map/itemdb.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2014-05-09 07:37:53 +0200
committerHaru <haru@dotalux.com>2014-05-09 07:40:43 +0200
commit5f1529083ad1f35a3ac66cc041ee74d6db2f3552 (patch)
tree32c4d73a7f68cd7a1a963e14e3972333758bb541 /src/map/itemdb.c
parent581ff22b9bad7567a27980df31636f0c75ba5fc2 (diff)
downloadhercules-5f1529083ad1f35a3ac66cc041ee74d6db2f3552.tar.gz
hercules-5f1529083ad1f35a3ac66cc041ee74d6db2f3552.tar.bz2
hercules-5f1529083ad1f35a3ac66cc041ee74d6db2f3552.tar.xz
hercules-5f1529083ad1f35a3ac66cc041ee74d6db2f3552.zip
Return EXIT_FAILURE if a script parse error occurred.
- This affects normal execution as well as ./script-checker runs. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/itemdb.c')
-rw-r--r--src/map/itemdb.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index 1bbe87a20..5eeb90be5 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -1478,7 +1478,7 @@ void itemdb_read_combos() {
CREATE(combo, struct item_combo, 1);
combo->count = retcount;
- combo->script = script->parse(str[1], filepath, lines, 0);
+ combo->script = script->parse(str[1], filepath, lines, 0, NULL);
combo->id = itemdb->combo_count - 1;
/* populate ->nameid field */
for( v = 0; v < retcount; v++ ) {
@@ -1707,9 +1707,9 @@ int itemdb_readdb_sql_sub(Sql *handle, int n, const char *source) {
SQL->GetData(handle, 19, &data, NULL); id.flag.no_refine = data && atoi(data) ? 0 : 1;
SQL->GetData(handle, 20, &data, NULL); id.look = data ? atoi(data) : 0;
SQL->GetData(handle, 21, &data, NULL); id.flag.bindonequip = data && atoi(data) ? 1 : 0;
- SQL->GetData(handle, 22, &data, NULL); id.script = data && *data ? script->parse(data, source, -id.nameid, SCRIPT_IGNORE_EXTERNAL_BRACKETS) : NULL;
- SQL->GetData(handle, 23, &data, NULL); id.equip_script = data && *data ? script->parse(data, source, -id.nameid, SCRIPT_IGNORE_EXTERNAL_BRACKETS) : NULL;
- SQL->GetData(handle, 24, &data, NULL); id.unequip_script = data && *data ? script->parse(data, source, -id.nameid, SCRIPT_IGNORE_EXTERNAL_BRACKETS) : NULL;
+ SQL->GetData(handle, 22, &data, NULL); id.script = data && *data ? script->parse(data, source, -id.nameid, SCRIPT_IGNORE_EXTERNAL_BRACKETS, NULL) : NULL;
+ SQL->GetData(handle, 23, &data, NULL); id.equip_script = data && *data ? script->parse(data, source, -id.nameid, SCRIPT_IGNORE_EXTERNAL_BRACKETS, NULL) : NULL;
+ SQL->GetData(handle, 24, &data, NULL); id.unequip_script = data && *data ? script->parse(data, source, -id.nameid, SCRIPT_IGNORE_EXTERNAL_BRACKETS, NULL) : NULL;
return itemdb->validate_entry(&id, n, source);
}
@@ -1875,13 +1875,13 @@ int itemdb_readdb_libconfig_sub(config_setting_t *it, int n, const char *source)
id.flag.bindonequip = libconfig->setting_get_bool(t) ? 1 : 0;
if( libconfig->setting_lookup_string(it, "Script", &str) )
- id.script = *str ? script->parse(str, source, -id.nameid, SCRIPT_IGNORE_EXTERNAL_BRACKETS) : NULL;
+ id.script = *str ? script->parse(str, source, -id.nameid, SCRIPT_IGNORE_EXTERNAL_BRACKETS, NULL) : NULL;
if( libconfig->setting_lookup_string(it, "OnEquipScript", &str) )
- id.equip_script = *str ? script->parse(str, source, -id.nameid, SCRIPT_IGNORE_EXTERNAL_BRACKETS) : NULL;
+ id.equip_script = *str ? script->parse(str, source, -id.nameid, SCRIPT_IGNORE_EXTERNAL_BRACKETS, NULL) : NULL;
if( libconfig->setting_lookup_string(it, "OnUnequipScript", &str) )
- id.unequip_script = *str ? script->parse(str, source, -id.nameid, SCRIPT_IGNORE_EXTERNAL_BRACKETS) : NULL;
+ id.unequip_script = *str ? script->parse(str, source, -id.nameid, SCRIPT_IGNORE_EXTERNAL_BRACKETS, NULL) : NULL;
return itemdb->validate_entry(&id, n, source);
}