summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKevin <Kevin@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-04-05 09:41:34 +0000
committerKevin <Kevin@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-04-05 09:41:34 +0000
commitede34865036ce2e80885a0f945ab18f7dbde6e53 (patch)
treedc23addfa35559103b20d76da05aa9886eb43996 /src
parent3907b21df79b5c48c75ed90e91247184e0edf689 (diff)
downloadhercules-ede34865036ce2e80885a0f945ab18f7dbde6e53.tar.gz
hercules-ede34865036ce2e80885a0f945ab18f7dbde6e53.tar.bz2
hercules-ede34865036ce2e80885a0f945ab18f7dbde6e53.tar.xz
hercules-ede34865036ce2e80885a0f945ab18f7dbde6e53.zip
Running now resumes after dmg as well, see (r12488). (bugreport:1155)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12490 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/unit.c35
1 files changed, 32 insertions, 3 deletions
diff --git a/src/map/unit.c b/src/map/unit.c
index bd738e786..6270c6c7a 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -748,6 +748,27 @@ int unit_can_move(struct block_list *bl)
return 1;
}
+
+/*==========================================
+ * Resume running after a walk delay
+ *------------------------------------------*/
+
+int unit_resume_running(int tid,unsigned int tick,int id,int data)
+{
+
+ struct unit_data *ud = (struct unit_data *)data;
+ TBL_PC * sd = map_id2sd(id);
+
+ clif_skill_nodamage(ud->bl,ud->bl,TK_RUN,ud->skilllv,
+ sc_start4(ud->bl,status_skill2sc(TK_RUN),100,ud->skilllv,unit_getdir(ud->bl),0,0,0));
+
+ if (sd) clif_walkok(sd);
+
+ return 0;
+
+}
+
+
/*==========================================
* Applies walk delay to character, considering that
* if type is 0, this is a damage induced delay: if previous delay is active, do not change it.
@@ -772,9 +793,17 @@ int unit_set_walkdelay(struct block_list *bl, unsigned int tick, int delay, int
{ //Minimal delay (walk-delay) disabled. Just stop walking.
unit_stop_walking(bl,0);
} else {
- unit_stop_walking(bl,2);
- if(ud->target)
- add_timer(ud->canmove_tick+1, unit_walktobl_sub, bl->id, ud->target);
+ //Resume running after can move again [Kevin]
+ if(ud->state.running)
+ {
+ add_timer(ud->canmove_tick, unit_resume_running, bl->id, (int)ud);
+ }
+ else
+ {
+ unit_stop_walking(bl,2);
+ if(ud->target)
+ add_timer(ud->canmove_tick+1, unit_walktobl_sub, bl->id, ud->target);
+ }
}
}
return 1;