Bläddra i källkod

- Now when a player's "attack once" request fails due to range, the client is told to move to the target to attack it. This sort of fixes the problem of the client SPAMMING the server with attack requests from afar without even approaching the icewall x_X

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9340 54d463be-8e91-2dee-dedb-b68131a5f0ec
skotlex 18 år sedan
förälder
incheckning
4f70932567
2 ändrade filer med 8 tillägg och 6 borttagningar
  1. 4 0
      Changelog-Trunk.txt
  2. 4 6
      src/map/unit.c

+ 4 - 0
Changelog-Trunk.txt

@@ -4,6 +4,10 @@ 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.
 
 2006/11/27
+	* Now when a player's "attack once" request fails due to range, the client
+	  is told to move to the target to attack it. This sort of fixes the problem
+	  of the client SPAMMING the server with attack requests from afar without
+	  even approaching the icewall. [Skotlex]
 	* Updated the status change field "option" to an int rather than short.
 	  This fixes the option values for xmas/sightblaster not getting set, which
 	  could explain why some people crash when equipping weapons while in xmas

+ 4 - 6
src/map/unit.c

@@ -1323,12 +1323,10 @@ static int unit_attack_timer_sub(struct block_list* src, int tid, unsigned int t
 
 	if(!check_distance_bl(src,target,range) ) {
 		//Chase if required.
-		if(ud->state.attack_continue) {
-			if(sd)
-				clif_movetoattack(sd,target);
-			else
-				unit_walktobl(src,target,ud->chaserange,ud->state.walk_easy|2);
-		}
+		if(sd)
+			clif_movetoattack(sd,target);
+		else if(ud->state.attack_continue)
+			unit_walktobl(src,target,ud->chaserange,ud->state.walk_easy|2);
 		return 1;
 	}
 	if(!battle_check_range(src,target,range)) {