diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-04-12 16:00:59 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-04-12 16:00:59 +0000 |
commit | a6df334cad1846131050e71fdee61c72b0450ef0 (patch) | |
tree | aa45dac1d9a499b7d4bec9ec134f6450a7b45de1 /src | |
parent | ac2549281f46ecf8cb1c6ced0cd6551d42a1c84b (diff) | |
download | hercules-a6df334cad1846131050e71fdee61c72b0450ef0.tar.gz hercules-a6df334cad1846131050e71fdee61c72b0450ef0.tar.bz2 hercules-a6df334cad1846131050e71fdee61c72b0450ef0.tar.xz hercules-a6df334cad1846131050e71fdee61c72b0450ef0.zip |
- Oops, little error on previous commit.
- And cleaned a bit the mob use skill code.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10236 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r-- | src/map/mob.c | 18 | ||||
-rw-r--r-- | src/map/skill.c | 2 |
2 files changed, 11 insertions, 9 deletions
diff --git a/src/map/mob.c b/src/map/mob.c index 43597979e..52507028d 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -2826,8 +2826,10 @@ int mobskill_use(struct mob_data *md, unsigned int tick, int event) map_search_freecell(&md->bl, md->bl.m, &x, &y, j, j, 3); } md->skillidx = i; - flag = unit_skilluse_pos2(&md->bl, x, y, ms[i].skill_id, ms[i].skill_lv, - ms[i].casttime, ms[i].cancel); + if (!unit_skilluse_pos2(&md->bl, x, y, + ms[i].skill_id, ms[i].skill_lv, + ms[i].casttime, ms[i].cancel)) + continue; } else { //Targetted skill switch (ms[i].target) { @@ -2858,15 +2860,12 @@ int mobskill_use(struct mob_data *md, unsigned int tick, int event) } if (!bl) continue; md->skillidx = i; - flag = unit_skilluse_id2(&md->bl, bl->id, ms[i].skill_id, ms[i].skill_lv, - ms[i].casttime, ms[i].cancel); + if (!unit_skilluse_id2(&md->bl, bl->id, + ms[i].skill_id, ms[i].skill_lv, + ms[i].casttime, ms[i].cancel)) + continue; } //Skill used. Post-setups... - if (!flag) - { //Skill failed. - md->skillidx = -1; - continue; - } if(battle_config.mob_ai&0x200) { //pass on delay to same skill. for (j = 0; j < md->db->maxskill; j++) @@ -2877,6 +2876,7 @@ int mobskill_use(struct mob_data *md, unsigned int tick, int event) return 1; } //No skill was used. + md->skillidx = -1; return 0; } /*========================================== diff --git a/src/map/skill.c b/src/map/skill.c index b2dfd3abd..72a100e5d 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -5678,6 +5678,8 @@ int skill_castend_id (int tid, unsigned int tick, int id, int data) inf = BCT_ENEMY; //Offensive skill. else if(inf2&INF2_NO_ENEMY) inf = BCT_NOENEMY; + else + inf =0; if(inf2 & (INF2_PARTY_ONLY|INF2_GUILD_ONLY) && src != target) { |