Skip to content

Commit

Permalink
Merge pull request #2015 from MishimaHaruna/fix-1875
Browse files Browse the repository at this point in the history
Prevent a null pointer failure when TK_JUMPKICK is used by a non-player
  • Loading branch information
MishimaHaruna committed Apr 8, 2018
2 parents 32968fa + 2a39694 commit 3a067ed
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/map/skill.c
Expand Up @@ -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:
Expand Down

0 comments on commit 3a067ed

Please sign in to comment.