summaryrefslogtreecommitdiff
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
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
-rw-r--r--Changelog-Trunk.txt1
-rw-r--r--src/map/unit.c11
2 files changed, 8 insertions, 4 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index d5ccb0669..35fe5243d 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,7 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2007/11/24
+ * Fixed a crash when a taekwon hits a wall while Sprinting (bugreport:483)
* Added support for latest official client/server packet changes [ultramage]
- enable by setting PACKETVER to 9; note that this breaks older clients
2007/11/23
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;