summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2018-07-29 20:42:08 +0200
committerGitHub <noreply@github.com>2018-07-29 20:42:08 +0200
commit67ac0a8d9aed95ee3c24e10d53737b54d781e2bf (patch)
tree871931690679357b5bc846ac91839bba34c4f449 /src/map
parenta95928b468d7aa1b069899ff023932e82a7b037f (diff)
parent18678ca6a144bd7bfdec1aa95feb9c19301d67dd (diff)
downloadhercules-67ac0a8d9aed95ee3c24e10d53737b54d781e2bf.tar.gz
hercules-67ac0a8d9aed95ee3c24e10d53737b54d781e2bf.tar.bz2
hercules-67ac0a8d9aed95ee3c24e10d53737b54d781e2bf.tar.xz
hercules-67ac0a8d9aed95ee3c24e10d53737b54d781e2bf.zip
Merge pull request #2161 from dastgirp/fix/coverity
Fix achievement issues
Diffstat (limited to 'src/map')
-rw-r--r--src/map/achievement.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/map/achievement.c b/src/map/achievement.c
index 0369b0fb5..6abdb74ee 100644
--- a/src/map/achievement.c
+++ b/src/map/achievement.c
@@ -1378,11 +1378,10 @@ static bool achievement_readdb_validate_criteria_itemtype(const struct config_se
}
} else if ((tt = libconfig->setting_get_member(t, "ItemType")) && config_setting_is_array(tt)) {
int j = 0;
- uint32 it_type = 0;
while (j < libconfig->setting_length(tt)) {
if ((val = libconfig->setting_get_int_elem(tt, j))) {
- if (val < IT_HEALING || val >= IT_MAX) {
+ if (val < IT_HEALING || val > IT_MAX) {
ShowError("achievement_readdb_validate_criteria_itemtype: Invalid ItemType %d provided (Achievement: %d, Objective: %d). Skipping...\n", val, entry_id, obj_idx);
continue;
}
@@ -1405,8 +1404,6 @@ static bool achievement_readdb_validate_criteria_itemtype(const struct config_se
}
j++;
}
-
- obj->item_type = it_type;
} else if (achievement_criteria_itemtype(type)) {
ShowError("achievement_readdb_validate_criteria_itemtype: Criteria requires a ItemType field (Achievement: %d, Objective: %d). Skipping...\n", entry_id, obj_idx);
return false;
@@ -1780,7 +1777,7 @@ static void achievement_readb(void)
if (libconfig->setting_lookup_int(conf, "Id", &t_ad.id) == 0) {
ShowError("achievement_readdb: Id field for entry %d is not provided! Skipping...\n", entry);
continue;
- } else if (t_ad.id <= 0 || t_ad.id > INT32_MAX) {
+ } else if (t_ad.id <= 0) {
ShowError("achievement_readdb: Invalid Id %d for entry %d. Skipping...\n", t_ad.id, entry);
continue;
}