diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-03-24 18:46:47 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-03-24 18:46:47 +0000 |
commit | ba3e9dafc6864419dadbc93cb22d017cfeb93b10 (patch) | |
tree | 09c22fa634b14dcdaa2e417cd324ae7694d520ea /src/map/mob.c | |
parent | ed8f721679a82f81af62ece387d8cef66b3eec89 (diff) | |
download | hercules-ba3e9dafc6864419dadbc93cb22d017cfeb93b10.tar.gz hercules-ba3e9dafc6864419dadbc93cb22d017cfeb93b10.tar.bz2 hercules-ba3e9dafc6864419dadbc93cb22d017cfeb93b10.tar.xz hercules-ba3e9dafc6864419dadbc93cb22d017cfeb93b10.zip |
- Fixed skillidx not being set whenever a mob uses a skill.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5734 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/mob.c')
-rw-r--r-- | src/map/mob.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/map/mob.c b/src/map/mob.c index e0488bc3d..71cf014ba 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -198,6 +198,7 @@ struct mob_data* mob_spawn_dataset(struct spawn_data *data) md->lootitem = (struct item *)aCalloc(LOOTITEM_SIZE,sizeof(struct item));
md->spawn_n = -1;
md->deletetimer = -1;
+ md->skillidx = -1;
for (i = 0; i < MAX_STATUSCHANGE; i++)
md->sc.data[i].timer = -1;
@@ -2822,8 +2823,11 @@ int mobskill_use(struct mob_data *md, unsigned int tick, int event) (ms[i].target-MST_AROUND5) +1;
map_search_freecell(&md->bl, md->bl.m, &x, &y, r, r, 3);
}
- return unit_skilluse_pos2(&md->bl, x, y, ms[i].skill_id, ms[i].skill_lv,
+ md->skillidx = i;
+ flag = unit_skilluse_pos2(&md->bl, x, y, ms[i].skill_id, ms[i].skill_lv,
skill_castfix(&md->bl,ms[i].skill_id, ms[i].skill_lv, ms[i].casttime), ms[i].cancel);
+ if (!flag) md->skillidx = -1; //Skill failed.
+ return flag;
} else {
// IDŽw’è
if (ms[i].target <= MST_MASTER) {
@@ -2850,8 +2854,11 @@ int mobskill_use(struct mob_data *md, unsigned int tick, int event) bl = &md->bl;
break;
}
- return (bl && unit_skilluse_id2(&md->bl, bl->id, ms[i].skill_id, ms[i].skill_lv,
+ md->skillidx = i;
+ flag = (bl && unit_skilluse_id2(&md->bl, bl->id, ms[i].skill_id, ms[i].skill_lv,
skill_castfix(&md->bl,ms[i].skill_id, ms[i].skill_lv, ms[i].casttime), ms[i].cancel));
+ if (!flag) md->skillidx = -1;
+ return flag;
} else {
if (battle_config.error_log)
ShowWarning("Wrong mob skill target 'around' for non-ground skill %d (%s). Mob %d - %s\n",
|