summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-27 21:00:39 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-27 21:00:39 +0000
commit7fde5cda86f543434529e5e5a79152091ca90744 (patch)
tree0db86210b49f6cae9efed842db00206b217fe1ae
parent85127739369c09fb398de34b2d39fe5af4ca11ed (diff)
downloadhercules-7fde5cda86f543434529e5e5a79152091ca90744.tar.gz
hercules-7fde5cda86f543434529e5e5a79152091ca90744.tar.bz2
hercules-7fde5cda86f543434529e5e5a79152091ca90744.tar.xz
hercules-7fde5cda86f543434529e5e5a79152091ca90744.zip
- unit_remove_map will reset attackable-time, canact and canwalk delays.
- Added a timer in clif.c so that walk requests that are done while your cannot move duration will be delayed and processed afterwards (as long as the walk delay remaining is less than 2000 ms) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6329 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt7
-rw-r--r--src/map/clif.c35
-rw-r--r--src/map/unit.c1
3 files changed, 37 insertions, 6 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 5ade3bdb3..edf68b010 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -3,7 +3,12 @@ Date Added
AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2006/04/27
- - Some changes in the slave skill conditions. All their skills are
+ * unit_remove_map will reset attackable-time, canact and canwalk delays.
+ [Skotlex]
+ * Added a timer in clif.c so that walk requests that are done while your
+ cannot move duration will be delayed and processed afterwards (as long as
+ the walk delay remaining is less than 2000 ms) [Skotlex]
+ * Some changes in the slave skill conditions. All their skills are
triggered at a 10% chance now. [Skotlex]
* Changed in the behaviour of wedding skills, they should be getting all
the land-skill checks now. [Skotlex]
diff --git a/src/map/clif.c b/src/map/clif.c
index 4fdccec63..8156d9e48 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -8194,6 +8194,24 @@ void clif_parse_TickSend(int fd, struct map_session_data *sd) {
clif_servertick(sd);
}
+static int clif_walktoxy_timer(int tid, unsigned int tick, int id, int data)
+{
+ struct map_session_data *sd;
+ short x,y;
+
+ if (!session[id] || (sd = session[id]->session_data) == NULL)
+ return 0;
+
+ if (!unit_can_move(&sd->bl))
+ return 0;
+
+ x = data>>16;
+ y = data&0xffff;
+
+ unit_walktoxy(&sd->bl, x, y, 0);
+ return 1;
+}
+
/*==========================================
*
*------------------------------------------
@@ -8201,6 +8219,7 @@ void clif_parse_TickSend(int fd, struct map_session_data *sd) {
void clif_parse_WalkToXY(int fd, struct map_session_data *sd) {
int x, y;
int cmd;
+ unsigned int tick;
RFIFOHEAD(fd);
if (pc_isdead(sd)) {
@@ -8215,8 +8234,6 @@ void clif_parse_WalkToXY(int fd, struct map_session_data *sd) {
return;
pc_stop_attack(sd);
- if (!unit_can_move(&sd->bl))
- return;
if (sd->invincible_timer != -1)
pc_delinvincibletimer(sd);
@@ -8228,9 +8245,17 @@ void clif_parse_WalkToXY(int fd, struct map_session_data *sd) {
(RFIFOB(fd,packet_db[sd->packet_ver][cmd].pos[0] + 2) >> 4);
//Set last idle time... [Skotlex]
sd->idletime = last_tick;
-
+
+ tick = gettick();
+ if (DIFF_TICK(sd->ud.canmove_tick, tick) > 0 &&
+ DIFF_TICK(sd->ud.canmove_tick, tick) < 2000)
+ { // Delay walking command. [Skotlex]
+ add_timer(sd->ud.canmove_tick+1, clif_walktoxy_timer, fd, (x<<16)|y);
+ return;
+ }
+ if (!unit_can_move(&sd->bl))
+ return;
unit_walktoxy(&sd->bl, x, y, 0);
-
}
/*==========================================
@@ -11625,7 +11650,7 @@ int do_init_clif(void) {
add_timer_func_list(clif_clearchar_delay_sub, "clif_clearchar_delay_sub");
add_timer_func_list(clif_delayquit, "clif_delayquit");
add_timer_func_list(clif_nighttimer, "clif_nighttimer");
-
+ add_timer_func_list(clif_walktoxy_timer, "clif_walktoxy_timer");
return 0;
}
diff --git a/src/map/unit.c b/src/map/unit.c
index 7cb9ceed1..8373095f3 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -1474,6 +1474,7 @@ int unit_remove_map(struct block_list *bl, int clrtype) {
unit_stop_attack(bl);
if (ud->skilltimer != -1)
unit_skillcastcancel(bl,0);
+ ud->attackabletime = ud->canmove_tick = ud->canact_tick = gettick();
clif_clearchar_area(bl,clrtype);
if (clrtype == 1) //Death. Remove all status changes.