diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-03-02 15:40:33 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-03-02 15:40:33 +0000 |
commit | c120372c4266e3705b3bed3966d06169d3f0a4b9 (patch) | |
tree | 46d72db2f53ec1d5c78ab7611cefc2f54efe161f /src/map/mob.c | |
parent | 0aeec655ffcf8b5ec07403d28230f58c6aa60a15 (diff) | |
download | hercules-c120372c4266e3705b3bed3966d06169d3f0a4b9.tar.gz hercules-c120372c4266e3705b3bed3966d06169d3f0a4b9.tar.bz2 hercules-c120372c4266e3705b3bed3966d06169d3f0a4b9.tar.xz hercules-c120372c4266e3705b3bed3966d06169d3f0a4b9.zip |
- Fixed mobs targetting themselves after using a support skill.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5427 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/mob.c')
-rw-r--r-- | src/map/mob.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/map/mob.c b/src/map/mob.c index c2f9680ca..d164275fd 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -3898,8 +3898,7 @@ int mobskill_event(struct mob_data *md, struct block_list *src, unsigned int tic int target_id, res = 0;
target_id = md->target_id;
- if (!target_id || (battle_config.mob_changetarget_byskill &&
- battle_check_target(&md->bl, src, BCT_ENEMY) > 0))
+ if (!target_id || battle_config.mob_changetarget_byskill)
md->target_id = src->id;
if (flag == -1)
@@ -3911,9 +3910,12 @@ int mobskill_event(struct mob_data *md, struct block_list *src, unsigned int tic else if (flag&BF_LONG)
res = mobskill_use(md, tick, MSC_LONGRANGEATTACKED);
- if (target_id && !res)
+ if (!res)
//Restore previous target only if skill condition failed to trigger. [Skotlex]
md->target_id = target_id;
+ //Otherwise check if the target is an enemy, and unlock if needed.
+ else if (battle_check_target(&md->bl, src, BCT_ENEMY) <= 0)
+ md->target_id = target_id;
return res;
}
|