summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAsheraf <Asheraf@users.noreply.github.com>2018-05-24 19:26:29 -0400
committerGitHub <noreply@github.com>2018-05-24 19:26:29 -0400
commit7bee81954a6ee741abbd87aa9ea2a6116c053811 (patch)
treefacf5e4b0d2dad30045c0e77eb38f965a0caa839 /src
parent5c9056c183421df41b546dc3031d251ee6c963b5 (diff)
parent9d159e4215d42dbbd0f1d4c330421b5f27ac28f7 (diff)
downloadhercules-7bee81954a6ee741abbd87aa9ea2a6116c053811.tar.gz
hercules-7bee81954a6ee741abbd87aa9ea2a6116c053811.tar.bz2
hercules-7bee81954a6ee741abbd87aa9ea2a6116c053811.tar.xz
hercules-7bee81954a6ee741abbd87aa9ea2a6116c053811.zip
Merge pull request #2042 from Asheraf/mobskillfollowup
fix a wrong iterator used for mob skill db parsing
Diffstat (limited to 'src')
-rw-r--r--src/map/mob.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index c0bf7946d..58afe4587 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -4879,7 +4879,7 @@ bool mob_skill_db_libconfig_sub(struct config_setting_t *it, int n)
bool mob_skill_db_libconfig_sub_skill(struct config_setting_t *it, int n, int mob_id)
{
- int i, j;
+ int i, j, idx = 0;
int i32;
int skill_id = 0;
int skill_idx = 0;
@@ -4910,8 +4910,8 @@ bool mob_skill_db_libconfig_sub_skill(struct config_setting_t *it, int n, int mo
memset(&gms, 0, sizeof (struct mob_skill));
ms = &gms;
} else {
- ARR_FIND(0, MAX_MOBSKILL, i, (ms = &mob->db_data[mob_id]->skill[i])->skill_id == 0);
- if (i == MAX_MOBSKILL) {
+ ARR_FIND(0, MAX_MOBSKILL, idx, (ms = &mob->db_data[mob_id]->skill[idx])->skill_id == 0);
+ if (idx == MAX_MOBSKILL) {
ShowError("mob_skill_db_libconfig_sub_skill: Too many skills for monster %d\n", mob_id);
return false;
}
@@ -5043,7 +5043,7 @@ bool mob_skill_db_libconfig_sub_skill(struct config_setting_t *it, int n, int mo
mob->db_data[i]->maxskill = j + 1;
}
} else { //Skill set on a single mob.
- mob->db_data[mob_id]->maxskill = i + 1;
+ mob->db_data[mob_id]->maxskill = idx + 1;
}
return true;