summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
authormalufett <malufett.eat.my.binaries@gmail.com>2013-02-01 22:14:25 +0800
committermalufett <malufett.eat.my.binaries@gmail.com>2013-02-01 22:15:49 +0800
commit63145d6d4079b692a3cd36eb340b9a0e71b9fbaa (patch)
treed5095b329d0e85320adb512624b8becd685fc095 /src/map/skill.c
parent7192b105201499e30a50c061e7ab2005c97d3714 (diff)
downloadhercules-63145d6d4079b692a3cd36eb340b9a0e71b9fbaa.tar.gz
hercules-63145d6d4079b692a3cd36eb340b9a0e71b9fbaa.tar.bz2
hercules-63145d6d4079b692a3cd36eb340b9a0e71b9fbaa.tar.xz
hercules-63145d6d4079b692a3cd36eb340b9a0e71b9fbaa.zip
Fixed Bug #7037
Where casting MO_EXTREMITY to untargetable targets causes the caster to move in fixed location/coordinate. http://hercules.ws/board/tracker/issue-7037-asura-strike-position/?gopid=16521#entry16521
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index ecd1ff8ac..448f54406 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -1,4 +1,4 @@
-// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
+// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
// For more information, see LICENCE in the main folder
#include "../common/cbasetypes.h"
@@ -9373,7 +9373,15 @@ int skill_castend_id(int tid, unsigned int tick, int id, intptr_t data)
}
if (target && target->m == src->m)
{ //Move character to target anyway.
- if (unit_movepos(src, src->x+3, src->y+3, 1, 1))
+ int dir, x, y;
+ dir = map_calc_dir(src,target->x,target->y);
+ if( dir > 0 && dir < 4) x = -2;
+ else if( dir > 4 ) x = 2;
+ else x = 0;
+ if( dir > 2 && dir < 6 ) y = -2;
+ else if( dir == 7 || dir < 2 ) y = 2;
+ else y = 0;
+ if (unit_movepos(src, src->x+x, src->y+y, 1, 1))
{ //Display movement + animation.
clif_slide(src,src->x,src->y);
clif_skill_damage(src,target,tick,sd->battle_status.amotion,0,0,1,ud->skill_id, ud->skill_lv, 5);