Переглянути джерело

* Follow up: r16011
1. Fixed a behavior which didn't unlock target when it was out of range. (bugrepor:7022)
2. Removed a redundant variable assignment.
* Follow up: r17029
1. Fixed @clearcart which was not deleting and updating the client properly.

- Special thanks to clydelion, on the fixes.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@17033 54d463be-8e91-2dee-dedb-b68131a5f0ec

markzd 12 роки тому
батько
коміт
7e433f00ff
3 змінених файлів з 7 додано та 1 видалено
  1. 6 0
      src/map/atcommand.c
  2. 1 0
      src/map/mob.c
  3. 0 1
      src/map/unit.c

+ 6 - 0
src/map/atcommand.c

@@ -5321,6 +5321,7 @@ ACMD_FUNC(cleargstorage)
 
 ACMD_FUNC(clearcart)
 {
+	int i;
 	nullpo_retr(-1, sd);
 	
 	if (pc_iscarton(sd) == 0) {
@@ -5332,7 +5333,12 @@ ACMD_FUNC(clearcart)
 		return -1;
 	}
 	
+	for( i = 0; i < MAX_CART; i++ )
+		if(sd->status.cart[i].nameid > 0)
+			pc_cart_delitem(sd, i, sd->status.cart[i].amount, 1, LOG_TYPE_OTHER);
+	
 	clif_clearcart(fd);
+	clif_updatestatus(sd,SP_CARTINFO);
 	
 	clif_displaymessage(fd, msg_txt(1397)); // Your cart was cleaned.
 	return 0;

+ 1 - 0
src/map/mob.c

@@ -1321,6 +1321,7 @@ int mob_unlocktarget(struct mob_data *md, unsigned int tick)
 	}
 	if (md->target_id) {
 		md->target_id=0;
+		md->ud.target_to = 0;
 		unit_set_target(&md->ud, 0);
 	}
 	return 0;

+ 0 - 1
src/map/unit.c

@@ -293,7 +293,6 @@ static int unit_walktoxy_timer(int tid, unsigned int tick, int id, intptr_t data
 	else {	//Stopped walking. Update to_x and to_y to current location [Skotlex]
 		ud->to_x = bl->x;
 		ud->to_y = bl->y;
-		ud->target_to = 0;
 	}
 	return 0;
 }