|
@@ -393,7 +393,21 @@ int unit_run(struct block_list *bl)
|
|
|
clif_status_change(bl, SI_BUMP, 0);
|
|
|
return 0;
|
|
|
}
|
|
|
- unit_walktoxy(bl, to_x, to_y, 1);
|
|
|
+ if (unit_walktoxy(bl, to_x, to_y, 1))
|
|
|
+ return 1;
|
|
|
+ //There must be an obstacle nearby. Attempt walking one cell at a time.
|
|
|
+ do {
|
|
|
+ to_x -= dir_x;
|
|
|
+ to_y -= dir_y;
|
|
|
+ } while (--i > 0 && !unit_walktoxy(bl, to_x, to_y, 1));
|
|
|
+ if (i==0) {
|
|
|
+ clif_status_change(bl, SI_BUMP, 1);
|
|
|
+ status_change_end(bl,SC_RUN,-1);
|
|
|
+ skill_blown(bl,bl,skill_get_blewcount(TK_RUN,sc->data[SC_RUN].val1)|0x10000);
|
|
|
+ clif_fixpos(bl);
|
|
|
+ clif_status_change(bl, SI_BUMP, 0);
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
return 1;
|
|
|
}
|
|
|
|