summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-09-18 15:09:30 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-09-18 15:09:30 +0000
commit09be69eca7b318cd1f3bcc16a7732712d1b705c7 (patch)
treeafcc0212eb45e2819cac5c2ca2b62023363b05e0 /src/map/skill.c
parent53e154561caec018e734900a0a4e53cf35e3f2c0 (diff)
downloadhercules-09be69eca7b318cd1f3bcc16a7732712d1b705c7.tar.gz
hercules-09be69eca7b318cd1f3bcc16a7732712d1b705c7.tar.bz2
hercules-09be69eca7b318cd1f3bcc16a7732712d1b705c7.tar.xz
hercules-09be69eca7b318cd1f3bcc16a7732712d1b705c7.zip
- Modified the Asura code (again), hopefully movement sprite issues are fixed now
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8793 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index af022a5af..34d1740db 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -2852,13 +2852,31 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, int
if (sc->data[SC_BLADESTOP].timer != -1)
status_change_end(src,SC_BLADESTOP,-1);
}
- //Client expects you to move to target regardless
- if(unit_walktobl(src, bl, 1, 1)) {
+ //Client expects you to move to target regardless of distance
+ {
struct unit_data *ud = unit_bl2ud(src);
+ short dx,dy;
int i,speed;
+
+ dx = bl->x - src->x;
+ dy = bl->y - src->y;
+ if (dx < 0) dx--;
+ else if (dx > 0) dx++;
+ if (dy < 0) dy--;
+ else if (dy > 0) dy++;
+ if (!dx && !dy) dy++;
+ if (map_getcell(src->m, src->x+dx, src->y+dy, CELL_CHKNOPASS))
+ {
+ dx = bl->x;
+ dy = bl->y;
+ } else {
+ dx = src->x + dx;
+ dy = src->y + dy;
+ }
+
skill_attack(BF_WEAPON,src,src,bl,skillid,skilllv,tick,flag);
- if (ud) {
- ud->target = 0; //Clear target, as you shouldn't be chasing it if you can't get there on time.
+
+ if(unit_walktoxy(src, dx, dy, 2) && ud) {
//Increase can't walk delay to not alter your walk path
ud->canmove_tick = tick;
speed = status_get_speed(src);