Explorar el Código

- Fixed player auto-attack not cancelling when dead.
- Some cleanups in skill_unit nooverlapping code.


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

skotlex hace 19 años
padre
commit
7509afab42
Se han modificado 3 ficheros con 6 adiciones y 12 borrados
  1. 2 0
      Changelog-Trunk.txt
  2. 1 0
      src/map/pc.c
  3. 3 12
      src/map/skill.c

+ 2 - 0
Changelog-Trunk.txt

@@ -4,6 +4,8 @@ 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.  EVERYTHING ELSE
 GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS
 
+2006/03/14
+	* Fixed player auto-attack not cancelling when dead. [Skotlex]
 2006/03/13
 	* Finished some checks to make sure Land Protector Only blocks BF_MAGIC
 	  skills. Hammerfall is no longer blocked. [Skotlex]

+ 1 - 0
src/map/pc.c

@@ -5311,6 +5311,7 @@ int pc_damage(struct block_list *src,struct map_session_data *sd,int damage)
 			duel_reject(sd->duel_invite, sd);
 	}
 
+	pc_stopattack(sd);
 	pc_stop_walking(sd,0);
 	skill_castcancel(&sd->bl,0);	// ‰r�¥‚Ì’†Ž~
 	skill_stop_dancing(&sd->bl); //You should stop dancing when dead... [Skotlex]

+ 3 - 12
src/map/skill.c

@@ -2054,13 +2054,9 @@ int skill_area_sub( struct block_list *bl,va_list ap )
 static int skill_check_unit_range_sub( struct block_list *bl,va_list ap )
 {
 	struct skill_unit *unit;
-	int *c;
 	int skillid,g_skillid;
 
-	nullpo_retr(0, bl);
-	nullpo_retr(0, ap);
-	nullpo_retr(0, unit = (struct skill_unit *)bl);
-	nullpo_retr(0, c = va_arg(ap,int *));
+	unit = (struct skill_unit *)bl;
 
 	if(bl->prev == NULL || bl->type != BL_SKILL)
 		return 0;
@@ -2100,14 +2096,11 @@ static int skill_check_unit_range_sub( struct block_list *bl,va_list ap )
 			break;
 	}
 
-	(*c)++;
-
 	return 1;
 }
 
 int skill_check_unit_range(int m,int x,int y,int skillid,int skilllv)
 {
-	int c = 0;
 	int range = skill_get_unit_range(skillid, skilllv);
 	int layout_type = skill_get_unit_layout_type(skillid,skilllv);
 	if (layout_type==-1 || layout_type>MAX_SQUARE_LAYOUT) {
@@ -2117,10 +2110,8 @@ int skill_check_unit_range(int m,int x,int y,int skillid,int skilllv)
 
 	// とりあえず?ウ方形のユニットレイアウトのみ対応
 	range += layout_type;
-	map_foreachinarea(skill_check_unit_range_sub,m,
-			x-range,y-range,x+range,y+range,BL_SKILL,&c,skillid);
-
-	return c;
+	return map_foreachinarea(skill_check_unit_range_sub,m,
+			x-range,y-range,x+range,y+range,BL_SKILL,skillid);
 }
 
 static int skill_check_unit_range2_sub( struct block_list *bl,va_list ap )