summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog-Trunk.txt2
-rw-r--r--src/map/unit.c35
2 files changed, 33 insertions, 4 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 635277115..db3262d8a 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,7 +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.
2008/04/05
- * DMG no longer stops running. (r12486) [Kevin]
+ * DMG no longer stops running. (r12488) [Kevin]
2008/04/04
* PCs/Mobs/NPCs now block Leap(TK_HIGHJUMP) and sprint(TK_RUN). (r12485) [Kevin]
* Disconnect user when receive select egg packet with no menu open. (r12484) [Kevin]
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;