summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2018-04-08 13:33:16 +0200
committerHaru <haru@dotalux.com>2018-04-08 13:33:16 +0200
commit2a396943739c09664d7d2bfcf074d7a1fa0d42ed (patch)
tree321ced05fa6eab85189421be501188116fe5677f /src/map
parent1248aa338a366d03d530c323b12de6f0ba61736a (diff)
downloadhercules-2a396943739c09664d7d2bfcf074d7a1fa0d42ed.tar.gz
hercules-2a396943739c09664d7d2bfcf074d7a1fa0d42ed.tar.bz2
hercules-2a396943739c09664d7d2bfcf074d7a1fa0d42ed.tar.xz
hercules-2a396943739c09664d7d2bfcf074d7a1fa0d42ed.zip
Prevent a null pointer failure when TK_JUMPKICK is used by a non-player
Fixes #1875 Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map')
-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: