summaryrefslogtreecommitdiff
path: root/src/map/unit.c
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-11-24 17:11:02 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-11-24 17:11:02 +0000
commit97c9f85e09080097835be749cc44adf9e79d10ef (patch)
tree86f2b8b8e98d8244ab6a514d6df80c76ad15472c /src/map/unit.c
parent0d88108ba8efb8da5e5d55e5a1ea3a3debd9fc8f (diff)
downloadhercules-97c9f85e09080097835be749cc44adf9e79d10ef.tar.gz
hercules-97c9f85e09080097835be749cc44adf9e79d10ef.tar.bz2
hercules-97c9f85e09080097835be749cc44adf9e79d10ef.tar.xz
hercules-97c9f85e09080097835be749cc44adf9e79d10ef.zip
Fixed a crash when a taekwon hits a wall while Sprinting (bugreport:483)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11795 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/unit.c')
-rw-r--r--src/map/unit.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/map/unit.c b/src/map/unit.c
index 0e01517dc..a9384eca9 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -402,6 +402,7 @@ int unit_run(struct block_list *bl)
{
struct status_change *sc = status_get_sc(bl);
short to_x,to_y,dir_x,dir_y;
+ int lv;
int i;
if (!(sc && sc->data[SC_RUN]))
@@ -412,11 +413,13 @@ int unit_run(struct block_list *bl)
return 0;
}
- to_x = bl->x;
- to_y = bl->y;
+ lv = sc->data[SC_RUN]->val1;
dir_x = dirx[sc->data[SC_RUN]->val2];
dir_y = diry[sc->data[SC_RUN]->val2];
+ // determine destination cell
+ to_x = bl->x;
+ to_y = bl->y;
for(i=0;i<AREA_SIZE;i++)
{
if(!map_getcell(bl->m,to_x+dir_x,to_y+dir_y,CELL_CHKPASS))
@@ -429,7 +432,7 @@ int unit_run(struct block_list *bl)
//If you can't run forward, you must be next to a wall, so bounce back. [Skotlex]
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),unit_getdir(bl),0);
+ skill_blown(bl,bl,skill_get_blewcount(TK_RUN,lv),unit_getdir(bl),0);
clif_fixpos(bl); //Why is a clif_slide (skill_blown) AND a fixpos needed? Ask Aegis.
clif_status_change(bl, SI_BUMP, 0);
return 0;
@@ -445,7 +448,7 @@ int unit_run(struct block_list *bl)
// copy-paste from above
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),unit_getdir(bl),0);
+ skill_blown(bl,bl,skill_get_blewcount(TK_RUN,lv),unit_getdir(bl),0);
clif_fixpos(bl);
clif_status_change(bl, SI_BUMP, 0);
return 0;