summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-02 15:40:33 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-02 15:40:33 +0000
commitc120372c4266e3705b3bed3966d06169d3f0a4b9 (patch)
tree46d72db2f53ec1d5c78ab7611cefc2f54efe161f
parent0aeec655ffcf8b5ec07403d28230f58c6aa60a15 (diff)
downloadhercules-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
-rw-r--r--Changelog-Trunk.txt1
-rw-r--r--src/map/mob.c8
2 files changed, 6 insertions, 3 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index cd1c0313a..a080b8536 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -5,6 +5,7 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. EV
GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS
2006/03/02
+ * Fixed mobs targetting themselves after using a support skill. [Skotlex]
* Gospel no longer blocks item usage of whoever is in the area of effect,
only the caster of Gospel can't use healing items now. [Skotlex]
* Added the long/near attack_def_rate card effects to battle_calc_magic
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;
}