summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2018-04-08 18:40:53 +0200
committerGitHub <noreply@github.com>2018-04-08 18:40:53 +0200
commit3a067ed5b4e57e6a5f2570421392e2add23947a7 (patch)
tree7a18a057442dd3695cc124a2f2ee42cf14268a57
parent32968fa05ddcdaa8764d84bcb8065c05763e5f8e (diff)
parent2a396943739c09664d7d2bfcf074d7a1fa0d42ed (diff)
downloadhercules-3a067ed5b4e57e6a5f2570421392e2add23947a7.tar.gz
hercules-3a067ed5b4e57e6a5f2570421392e2add23947a7.tar.bz2
hercules-3a067ed5b4e57e6a5f2570421392e2add23947a7.tar.xz
hercules-3a067ed5b4e57e6a5f2570421392e2add23947a7.zip
Merge pull request #2015 from MishimaHaruna/fix-1875
Prevent a null pointer failure when TK_JUMPKICK is used by a non-player
-rw-r--r--src/map/skill.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index 3d541bf76..9108b6575 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -6503,16 +6503,14 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
case TK_JUMPKICK:
/* Check if the target is an enemy; if not, skill should fail so the character doesn't unit->movepos (exploitable) */
- if( battle->check_target(src, bl, BCT_ENEMY) > 0 )
- {
- if( unit->movepos(src, bl->x, bl->y, 1, 1) )
- {
- skill->attack(BF_WEAPON,src,src,bl,skill_id,skill_lv,tick,flag);
- clif->slide(src,bl->x,bl->y);
+ if (battle->check_target(src, bl, BCT_ENEMY) > 0) {
+ if (unit->movepos(src, bl->x, bl->y, 1, 1)) {
+ skill->attack(BF_WEAPON, src, src, bl, skill_id, skill_lv, tick, flag);
+ clif->slide(src, bl->x, bl->y);
}
+ } else if (sd != NULL) {
+ clif->skill_fail(sd, skill_id, USESKILL_FAIL, 0);
}
- else
- clif->skill_fail(sd,skill_id,USESKILL_FAIL,0);
break;
case AL_INCAGI: