Ver Fonte

- Now when walkdelay is set to 0, characters will stop walking when hit, but will not have any walk delay.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6486 54d463be-8e91-2dee-dedb-b68131a5f0ec
skotlex há 19 anos atrás
pai
commit
740958837d
3 ficheiros alterados com 13 adições e 7 exclusões
  1. 4 0
      Changelog-Trunk.txt
  2. 1 4
      src/map/clif.c
  3. 8 3
      src/map/unit.c

+ 4 - 0
Changelog-Trunk.txt

@@ -3,6 +3,10 @@ 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/05/05
+	* Now when walkdelay is set to 0, characters will stop walking when hit,
+	  but will not have any walk delay. (previously setting walk delay to 0 would
+	  not even stop characters from walking when hit) [Skotlex]
 2006/05/04
 	* Some people think its sexy to declare variables after blocks of code. Fixed. [Zido]
 	* Fixed a possible infinite loop in skill_clear_unit_group [Skotlex]

+ 1 - 4
src/map/clif.c

@@ -3837,10 +3837,7 @@ static int clif_calc_walkdelay(struct block_list *bl,int delay, int type, int da
 	if (div_ > 1) //Multi-hit skills mean higher delays.
 		delay += battle_config.multihit_delay*(div_-1);
 
-	if (delay <= 0)
-		return 0;
-
-	return delay>0?delay:0;
+	return delay>0?delay:1; //Return 1 to specify there should be no noticeable delay, but you should stop walking.
 }
 
 /*==========================================

+ 8 - 3
src/map/unit.c

@@ -674,9 +674,14 @@ int unit_set_walkdelay(struct block_list *bl, unsigned int tick, int delay, int
 	ud->canmove_tick = tick + delay;
 	if (ud->walktimer != -1)
 	{	//Stop walking, if chasing, readjust timers.
-		unit_stop_walking(bl,3);
-		if(ud->target)
-			add_timer(ud->canmove_tick+1, unit_walktobl_sub, bl->id, ud->target);
+		if (delay == 1)
+		{	//Minimal delay (walk-delay) disabled. Just stop walking.
+			unit_stop_walking(bl,1);
+		} else {
+			unit_stop_walking(bl,3);
+			if(ud->target)
+				add_timer(ud->canmove_tick+1, unit_walktobl_sub, bl->id, ud->target);
+		}
 	}
 	return 1;
 }